Completed
Push — ft/package ( 7b41d6...ceb161 )
by Philippe
13:50
created
database/factories/ModelFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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(),
Please login to merge, or discard this patch.
config/chief.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
app/Console/CreateAdmin.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,27 +16,27 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
app/Console/RefreshDatabase.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         });
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/Back/Authorization/PermissionController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
app/Http/Controllers/Back/Authorization/RoleController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Back/PagesController.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,10 +91,16 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/Back/Users/UserController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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
         ]);
Please login to merge, or discard this patch.