Completed
Branch master (15e06a)
by Mamikon
01:58
created
Category
src/migrations/2017_04_02_135623_create_permissions_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         Schema::create(
17 17
             config('roleManager.permissionsTable'),
18
-            function (Blueprint $table) {
18
+            function(Blueprint $table) {
19 19
                 $table->increments('id');
20 20
                 $table->char('name', 255)->unique();
21 21
                 $table->text('description')->nullable();
Please login to merge, or discard this patch.
src/migrations/2017_04_02_135756_create_roles_table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create(config('roleManager.rolesTable'), function (Blueprint $table) {
16
+        Schema::create(config('roleManager.rolesTable'), function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->char('name', 255)->unique();
19 19
             $table->text('description')->nullable();
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         });
22 22
         Schema::create(
23 23
             'permissions_roles',
24
-            function (Blueprint $table) {
24
+            function(Blueprint $table) {
25 25
                 $table->increments('id');
26 26
                 $table->integer('roles_id')->unsigned();
27 27
                 $table->integer('permissions_id')->unsigned();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         Schema::create(
40 40
             'roles_user',
41
-            function (Blueprint $table) {
41
+            function(Blueprint $table) {
42 42
                 $table->increments('id');
43 43
                 $table->integer('user_id')->unsigned();
44 44
                 $table->integer('roles_id')->unsigned();
Please login to merge, or discard this patch.
src/Models/Permissions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
  */
15 15
 class Permissions extends Model
16 16
 {
17
-    protected $fillable = ['name', 'description', 'class', 'method'];
17
+    protected $fillable = [ 'name', 'description', 'class', 'method' ];
18 18
 
19 19
     /**
20 20
      * Permissions constructor.
21 21
      *
22 22
      * @param array $attributes
23 23
      */
24
-    public function __construct(array $attributes = [])
24
+    public function __construct(array $attributes = [ ])
25 25
     {
26 26
         parent::__construct($attributes);
27 27
         $this->table = config('roleManager.permissionsTable');
Please login to merge, or discard this patch.
src/Models/Roles.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@
 block discarded – undo
15 15
  */
16 16
 class Roles extends Model
17 17
 {
18
-    protected $fillable = ['name', 'description'];
18
+    protected $fillable = [ 'name', 'description' ];
19 19
 
20 20
     /**
21 21
      * Roles constructor.
22 22
      *
23 23
      * @param array $attributes
24 24
      */
25
-    public function __construct(array $attributes = [])
25
+    public function __construct(array $attributes = [ ])
26 26
     {
27 27
         parent::__construct($attributes);
28 28
         $this->table = config('roleManager.rolesTable');
Please login to merge, or discard this patch.
src/RoleManager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
             Gate::define(
33 33
                 $permission->name,
34
-                function ($user, ...$arguments) use ($permission) {
34
+                function($user, ...$arguments) use ($permission) {
35 35
                     foreach ($permission->roles as $role) {
36 36
                         if ($role->belongsToUser($user)) {
37 37
                             if (!empty($permission->class)
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                                     array_unshift($arguments, $user);
44 44
                                     return
45 45
                                         call_user_func_array(
46
-                                            [$container, $permission->method],
46
+                                            [ $container, $permission->method ],
47 47
                                             $arguments
48 48
                                         );
49 49
                                 } else {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         if (Schema::hasTable(config('roleManager.permissionsTable'))) {
122 122
             return Permissions::with('roles')->get();
123 123
         }
124
-        return [];
124
+        return [ ];
125 125
     }
126 126
 
127 127
 }
128 128
\ No newline at end of file
Please login to merge, or discard this patch.
src/routes.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 Route::group(
3
-    ['middleware' => ['web'],
3
+    [ 'middleware' => [ 'web' ],
4 4
     'as' => 'RoleManager::',
5
-    'prefix' => trim(config('roleManager.routePrefix'), '/')],
6
-    function () {
5
+    'prefix' => trim(config('roleManager.routePrefix'), '/') ],
6
+    function() {
7 7
         Route::get(
8 8
             '/', 'Mamikon\RoleManager\Controllers\RoleManagerController@index'
9 9
         )->name('home');
@@ -20,13 +20,13 @@  discard block
 block discarded – undo
20 20
 
21 21
         Route::resource(
22 22
             '/role', 'Mamikon\RoleManager\Controllers\RoleController',
23
-            ['except' => ['show']]
23
+            [ 'except' => [ 'show' ] ]
24 24
         );
25 25
 
26 26
         Route::resource(
27 27
             '/permission',
28 28
             'Mamikon\RoleManager\Controllers\PermissionController',
29
-            ['except' => ['show']]
29
+            [ 'except' => [ 'show' ] ]
30 30
         );
31 31
     }
32 32
 );
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
src/Controllers/PermissionController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         }
46 46
         return view(
47 47
             "RoleManager::permission.index",
48
-            ['permissions' => $permissions]
48
+            [ 'permissions' => $permissions ]
49 49
         );
50 50
     }
51 51
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     public function edit(Permissions $permission)
87 87
     {
88 88
         $this->authorize('edit_permission');
89
-        return view('RoleManager::permission.edit', ['permission' => $permission]);
89
+        return view('RoleManager::permission.edit', [ 'permission' => $permission ]);
90 90
     }
91 91
 
92 92
     /**
Please login to merge, or discard this patch.
src/Controllers/RoleManagerController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         } else {
40 40
             $users = User::paginate(config('roleManager.usersPerPage'));
41 41
         }
42
-        return view('RoleManager::index', ['users' => $users]);
42
+        return view('RoleManager::index', [ 'users' => $users ]);
43 43
     }
44 44
 
45 45
     /**
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
         if (!empty($roles)) {
59 59
             foreach ($roles as $role) {
60 60
                 if ($role->belongsToUser($user)) {
61
-                    $valueList[] = $role->id;
61
+                    $valueList[ ] = $role->id;
62 62
                 }
63 63
             }
64 64
         }
65 65
         return view(
66 66
             'RoleManager::edit',
67
-            ['user' => $user, 'roles' => Roles::all(), 'valueList' => $valueList]
67
+            [ 'user' => $user, 'roles' => Roles::all(), 'valueList' => $valueList ]
68 68
         );
69 69
     }
70 70
 
Please login to merge, or discard this patch.
src/Controllers/RoleController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         } else {
39 39
             $roles = Roles::paginate(config('roleManager.rolesPerPage'));
40 40
         }
41
-        return view('RoleManager::role.index', ['roles' => $roles]);
41
+        return view('RoleManager::role.index', [ 'roles' => $roles ]);
42 42
     }
43 43
 
44 44
     /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
         return view(
54 54
             'RoleManager::role.create',
55
-            ['permissions' => Permissions::all()]
55
+            [ 'permissions' => Permissions::all() ]
56 56
         );
57 57
     }
58 58
 
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
         $valueList = $role->permissions()->get()->pluck('id')->toArray();
93 93
         return view(
94 94
             'RoleManager::role.edit',
95
-            ['role' => $role, 'permissions' => Permissions::all(),
96
-                'valueList' => $valueList]
95
+            [ 'role' => $role, 'permissions' => Permissions::all(),
96
+                'valueList' => $valueList ]
97 97
         );
98 98
     }
99 99
 
Please login to merge, or discard this patch.