@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | use Thinktomorrow\Chief\Users\User; |
4 | 4 | use Thinktomorrow\Chief\Pages\Page; |
5 | 5 | |
6 | -$factory->define(User::class, function (Faker\Generator $faker) { |
|
6 | +$factory->define(User::class, function(Faker\Generator $faker) { |
|
7 | 7 | |
8 | 8 | static $password; |
9 | 9 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | ]; |
16 | 16 | }); |
17 | 17 | |
18 | -$factory->define(Page::class, function (Faker\Generator $faker) { |
|
18 | +$factory->define(Page::class, function(Faker\Generator $faker) { |
|
19 | 19 | return [ |
20 | 20 | 'published' => $faker->boolean(), |
21 | 21 | 'featured' => $faker->boolean(), |
@@ -7,8 +7,8 @@ |
||
7 | 7 | * This contact will receive e.g. contact form submissions |
8 | 8 | */ |
9 | 9 | 'contact' => [ |
10 | - 'email' => env('MAIL_ADMIN_EMAIL','[email protected]'), |
|
11 | - 'name' => env('MAIL_ADMIN_NAME','Think Tomorrow') |
|
10 | + 'email' => env('MAIL_ADMIN_EMAIL', '[email protected]'), |
|
11 | + 'name' => env('MAIL_ADMIN_NAME', 'Think Tomorrow') |
|
12 | 12 | ], |
13 | 13 | |
14 | 14 | /** |
@@ -16,27 +16,27 @@ |
||
16 | 16 | |
17 | 17 | $anticipations = $this->getAnticipations(); |
18 | 18 | |
19 | - $firstname = $this->anticipate('firstname',array_pluck($anticipations,'firstname')); |
|
19 | + $firstname = $this->anticipate('firstname', array_pluck($anticipations, 'firstname')); |
|
20 | 20 | $anticipatedLastname = null; |
21 | - $lastname = $this->anticipate('lastname',array_pluck($anticipations,'lastname'),$anticipatedLastname); |
|
21 | + $lastname = $this->anticipate('lastname', array_pluck($anticipations, 'lastname'), $anticipatedLastname); |
|
22 | 22 | |
23 | - $email = $this->ask('email',str_slug($firstname).'@thinktomorrow.be'); |
|
23 | + $email = $this->ask('email', str_slug($firstname).'@thinktomorrow.be'); |
|
24 | 24 | |
25 | 25 | $password = $this->askPassword(); |
26 | 26 | |
27 | 27 | $this->createUser($firstname, $lastname, $email, $password, ['admin']); |
28 | 28 | |
29 | - $this->info($firstname.' '.$lastname. ' succesfully added as admin user.'); |
|
29 | + $this->info($firstname.' '.$lastname.' succesfully added as admin user.'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | private function settingPermissionsAndRoles() |
33 | 33 | { |
34 | - AuthorizationDefaults::permissions()->each(function($permissionName){ |
|
34 | + AuthorizationDefaults::permissions()->each(function($permissionName) { |
|
35 | 35 | Artisan::call('chief:permission', ['name' => $permissionName]); |
36 | 36 | }); |
37 | 37 | |
38 | - AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName){ |
|
39 | - Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',',$defaultPermissions)]); |
|
38 | + AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName) { |
|
39 | + Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',', $defaultPermissions)]); |
|
40 | 40 | }); |
41 | 41 | |
42 | 42 | $this->info('Default permissions and roles'); |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | |
15 | 15 | public function handle() |
16 | 16 | { |
17 | - if(app()->environment() != 'local' && !$this->option('force')) |
|
17 | + if (app()->environment() != 'local' && !$this->option('force')) |
|
18 | 18 | { |
19 | 19 | throw new \Exception('Aborting. This command is dangerous and only meant for your local environment.'); |
20 | 20 | } |
21 | 21 | |
22 | - if(app()->environment() != 'local' && $this->option('force')) |
|
22 | + if (app()->environment() != 'local' && $this->option('force')) |
|
23 | 23 | { |
24 | 24 | if (!$this->confirm('You are about to force refresh the database in the '.app()->environment().' environment! ARE YOU SURE?')) { |
25 | 25 | $this->info('aborting.'); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - if($this->option('force')){ |
|
35 | + if ($this->option('force')) { |
|
36 | 36 | $this->call('migrate:fresh', ['--force' => true]); |
37 | - }else{ |
|
37 | + }else { |
|
38 | 38 | $this->call('migrate:fresh'); |
39 | 39 | } |
40 | 40 | |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | |
51 | 51 | private function settingPermissionsAndRoles() |
52 | 52 | { |
53 | - AuthorizationDefaults::permissions()->each(function($permissionName){ |
|
53 | + AuthorizationDefaults::permissions()->each(function($permissionName) { |
|
54 | 54 | Artisan::call('chief:permission', ['name' => $permissionName]); |
55 | 55 | }); |
56 | 56 | |
57 | - AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName){ |
|
58 | - Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',',$defaultPermissions)]); |
|
57 | + AuthorizationDefaults::roles()->each(function($defaultPermissions, $roleName) { |
|
58 | + Artisan::call('chief:role', ['name' => $roleName, '--permissions' => implode(',', $defaultPermissions)]); |
|
59 | 59 | }); |
60 | 60 | |
61 | 61 | $this->info('Default permissions and roles'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ['Json', 'Voorhees', '[email protected]', $password], |
80 | 80 | ]); |
81 | 81 | |
82 | - $admins->each(function($admin){ |
|
82 | + $admins->each(function($admin) { |
|
83 | 83 | $this->createUser($admin[0], $admin[1], $admin[2], $admin[3], 'developer'); |
84 | 84 | $this->info('Added '.$admin[0].' as developer role with your provided password.'); |
85 | 85 | }); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | if($this->option('force')){ |
36 | 36 | $this->call('migrate:fresh', ['--force' => true]); |
37 | - }else{ |
|
37 | + } else{ |
|
38 | 38 | $this->call('migrate:fresh'); |
39 | 39 | } |
40 | 40 |
@@ -25,14 +25,14 @@ |
||
25 | 25 | 'password' => 'required|min:6', |
26 | 26 | ]); |
27 | 27 | |
28 | - if(Auth::guard('chief')->attempt(['email' => $request->email, 'password' => $request->password], $request->remember)) |
|
28 | + if (Auth::guard('chief')->attempt(['email' => $request->email, 'password' => $request->password], $request->remember)) |
|
29 | 29 | { |
30 | 30 | return redirect()->intended(route('chief.back.dashboard')); |
31 | 31 | } |
32 | 32 | |
33 | 33 | $failedAttempt = 'Uw gegevens zijn onjuist of uw account is nog niet actief.'; |
34 | 34 | |
35 | - return redirect()->back()->withInput($request->only('email','remember'))->withErrors($failedAttempt); |
|
35 | + return redirect()->back()->withInput($request->only('email', 'remember'))->withErrors($failedAttempt); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | return redirect()->route('chief.back.permissions.index') |
58 | 58 | ->with('flash_message', |
59 | - 'Permission'. $permission->name.' added!'); |
|
59 | + 'Permission'.$permission->name.' added!'); |
|
60 | 60 | } |
61 | 61 | /** |
62 | 62 | * Display the specified resource. |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $permission->fill($input)->save(); |
99 | 99 | return redirect()->route('chief.back.permissions.index') |
100 | 100 | ->with('flash_message', |
101 | - 'Permission'. $permission->name.' updated!'); |
|
101 | + 'Permission'.$permission->name.' updated!'); |
|
102 | 102 | } |
103 | 103 | /** |
104 | 104 | * Remove the specified resource from storage. |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $role->givePermissionTo($request->permission_names); |
43 | 43 | |
44 | 44 | return redirect()->route('chief.back.roles.index') |
45 | - ->with('messages.success', 'Rol '. $role->name.' is toegevoegd.'); |
|
45 | + ->with('messages.success', 'Rol '. $role->name.' is toegevoegd.'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function edit($id) |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $this->authorize('view-role'); |
15 | 15 | |
16 | - return view('chief::back.authorization.roles.index',[ |
|
16 | + return view('chief::back.authorization.roles.index', [ |
|
17 | 17 | 'roles' => Role::all(), |
18 | 18 | ]); |
19 | 19 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $role->givePermissionTo($request->permission_names); |
43 | 43 | |
44 | 44 | return redirect()->route('chief.back.roles.index') |
45 | - ->with('messages.success', 'Rol '. $role->name.' is toegevoegd.'); |
|
45 | + ->with('messages.success', 'Rol '.$role->name.' is toegevoegd.'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function edit($id) |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $role->syncPermissions($request->permission_names); |
72 | 72 | |
73 | 73 | return redirect()->route('chief.back.roles.index') |
74 | - ->with('messages.success', 'Rol '. $role->name.' is aangepast.'); |
|
74 | + ->with('messages.success', 'Rol '.$role->name.' is aangepast.'); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function destroy($id) |
@@ -82,6 +82,6 @@ discard block |
||
82 | 82 | $role->delete(); |
83 | 83 | |
84 | 84 | return redirect()->route('chief.back.roles.index') |
85 | - ->with('messages.success', 'Rol '. $role->name.' is verwijderd.'); |
|
85 | + ->with('messages.success', 'Rol '.$role->name.' is verwijderd.'); |
|
86 | 86 | } |
87 | 87 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $page->existingRelationIds = collect([]); |
36 | 36 | $relations = RelatedCollection::availableChildren($page)->flattenForGroupedSelect()->toArray(); |
37 | 37 | |
38 | - return view('chief::back.pages.create',['page' => $page, 'relations' => $relations]); |
|
38 | + return view('chief::back.pages.create', ['page' => $page, 'relations' => $relations]); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $page = app(CreatePage::class)->handle($request->trans); |
50 | 50 | |
51 | - return redirect()->route('chief.back.pages.index')->with('messages.success', $page->title .' is aangemaakt'); |
|
51 | + return redirect()->route('chief.back.pages.index')->with('messages.success', $page->title.' is aangemaakt'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $page = app(UpdatePage::class)->handle($id, $request->trans, $request->relations); |
81 | 81 | |
82 | - return redirect()->route('chief.back.pages.index')->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "'.$page->title .'" werd aangepast'); |
|
82 | + return redirect()->route('chief.back.pages.index')->with('messages.success', '<i class="fa fa-fw fa-check-circle"></i> "'.$page->title.'" werd aangepast'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | public function destroy($id) |
92 | 92 | { |
93 | 93 | $page = Page::findOrFail($id); |
94 | - if(request()->get('deleteconfirmation') !== 'DELETE' && (!$page->isPublished() || $page->isArchived())) return redirect()->back()->with('messages.warning', 'fout'); |
|
94 | + if (request()->get('deleteconfirmation') !== 'DELETE' && (!$page->isPublished() || $page->isArchived())) return redirect()->back()->with('messages.warning', 'fout'); |
|
95 | 95 | |
96 | - if($page->isDraft() || $page->isArchived()) $page->delete(); |
|
97 | - if($page->isPublished()) $page->archive(); |
|
96 | + if ($page->isDraft() || $page->isArchived()) $page->delete(); |
|
97 | + if ($page->isPublished()) $page->archive(); |
|
98 | 98 | |
99 | 99 | $message = 'Het item werd verwijderd.'; |
100 | 100 | |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | |
104 | 104 | public function publish(Request $request) |
105 | 105 | { |
106 | - $page = Page::findOrFail($request->get('id')); |
|
107 | - $published = true === !$request->checkboxStatus; // string comp. since bool is passed as string |
|
106 | + $page = Page::findOrFail($request->get('id')); |
|
107 | + $published = true === !$request->checkboxStatus; // string comp. since bool is passed as string |
|
108 | 108 | |
109 | 109 | ($published) ? $page->publish() : $page->draft(); |
110 | 110 |
@@ -91,10 +91,16 @@ |
||
91 | 91 | public function destroy($id) |
92 | 92 | { |
93 | 93 | $page = Page::findOrFail($id); |
94 | - if(request()->get('deleteconfirmation') !== 'DELETE' && (!$page->isPublished() || $page->isArchived())) return redirect()->back()->with('messages.warning', 'fout'); |
|
95 | - |
|
96 | - if($page->isDraft() || $page->isArchived()) $page->delete(); |
|
97 | - if($page->isPublished()) $page->archive(); |
|
94 | + if(request()->get('deleteconfirmation') !== 'DELETE' && (!$page->isPublished() || $page->isArchived())) { |
|
95 | + return redirect()->back()->with('messages.warning', 'fout'); |
|
96 | + } |
|
97 | + |
|
98 | + if($page->isDraft() || $page->isArchived()) { |
|
99 | + $page->delete(); |
|
100 | + } |
|
101 | + if($page->isPublished()) { |
|
102 | + $page->archive(); |
|
103 | + } |
|
98 | 104 | |
99 | 105 | $message = 'Het item werd verwijderd.'; |
100 | 106 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | { |
61 | 61 | $this->authorize('update-user'); |
62 | 62 | |
63 | - return view('chief::back.users.edit',[ |
|
63 | + return view('chief::back.users.edit', [ |
|
64 | 64 | 'user' => User::findOrFail($id), |
65 | 65 | 'roleNames'=> Role::all()->pluck('name')->toArray() |
66 | 66 | ]); |