@@ -48,57 +48,57 @@ |
||
| 48 | 48 | |
| 49 | 49 | protected function blade() |
| 50 | 50 | { |
| 51 | - if (! Config::useBlade()) { |
|
| 51 | + if ( ! Config::useBlade()) { |
|
| 52 | 52 | return; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /* Role */ |
| 56 | - Blade::directive('role', function ($role) { |
|
| 56 | + Blade::directive('role', function($role) { |
|
| 57 | 57 | return "<?php if(\auth()->check() && \auth()->user()->hasRole($role)) { ?>"; |
| 58 | 58 | }); |
| 59 | 59 | |
| 60 | - Blade::directive('endrole', function () { |
|
| 60 | + Blade::directive('endrole', function() { |
|
| 61 | 61 | return '<?php } ?>'; |
| 62 | 62 | }); |
| 63 | 63 | |
| 64 | 64 | /* Roles */ |
| 65 | - Blade::directive('role', function ($roles) { |
|
| 65 | + Blade::directive('role', function($roles) { |
|
| 66 | 66 | return "<?php if(\auth()->check() && \auth()->user()->hasRoles($roles)) { ?>"; |
| 67 | 67 | }); |
| 68 | 68 | |
| 69 | - Blade::directive('endroles', function () { |
|
| 69 | + Blade::directive('endroles', function() { |
|
| 70 | 70 | return '<?php } ?>'; |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | 73 | /* Permission */ |
| 74 | - Blade::directive('permission', function ($permission) { |
|
| 74 | + Blade::directive('permission', function($permission) { |
|
| 75 | 75 | return "<?php if(\auth()->check() && \auth()->user()->hasPermission($permission)) ?>"; |
| 76 | 76 | }); |
| 77 | 77 | |
| 78 | - Blade::directive('endpermission', function () { |
|
| 78 | + Blade::directive('endpermission', function() { |
|
| 79 | 79 | return '<?php } ?>'; |
| 80 | 80 | }); |
| 81 | 81 | |
| 82 | 82 | /* Permissions */ |
| 83 | - Blade::directive('permissions', function ($permissions) { |
|
| 83 | + Blade::directive('permissions', function($permissions) { |
|
| 84 | 84 | return "<?php if(\auth()->check() && \auth()->user()->hasPermissions($permissions)) ?>"; |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | - Blade::directive('endpermissions', function () { |
|
| 87 | + Blade::directive('endpermissions', function() { |
|
| 88 | 88 | return '<?php } ?>'; |
| 89 | 89 | }); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | protected function can() |
| 93 | 93 | { |
| 94 | - if (! Config::useCanDirective()) { |
|
| 94 | + if ( ! Config::useCanDirective()) { |
|
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | Permission::query() |
| 99 | 99 | ->get(['slug']) |
| 100 | - ->each(function (Permission $permission) { |
|
| 101 | - Gate::define($permission->slug, function (Authenticatable $user) use ($permission) { |
|
| 100 | + ->each(function(Permission $permission) { |
|
| 101 | + Gate::define($permission->slug, function(Authenticatable $user) use ($permission) { |
|
| 102 | 102 | return $user->hasPermission($permission); |
| 103 | 103 | }); |
| 104 | 104 | }); |
@@ -19,14 +19,14 @@ |
||
| 19 | 19 | |
| 20 | 20 | protected function addTitleColumn(string $table): void |
| 21 | 21 | { |
| 22 | - $this->table($table, function (Blueprint $table) { |
|
| 22 | + $this->table($table, function(Blueprint $table) { |
|
| 23 | 23 | $table->string('title')->nullable()->after('slug'); |
| 24 | 24 | }); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | protected function dropTitleColumn(string $table): void |
| 28 | 28 | { |
| 29 | - $this->table($table, function (Blueprint $table) { |
|
| 29 | + $this->table($table, function(Blueprint $table) { |
|
| 30 | 30 | $table->dropColumn('title'); |
| 31 | 31 | }); |
| 32 | 32 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | protected function renameColumn(string $table, string $from, string $to) |
| 21 | 21 | { |
| 22 | - $this->table($table, function (Blueprint $table) use ($from, $to) { |
|
| 22 | + $this->table($table, function(Blueprint $table) use ($from, $to) { |
|
| 23 | 23 | $table->renameColumn($from, $to); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | protected function optimizeIndexes(string $table, string $first_key, string $second_key) |
| 21 | 21 | { |
| 22 | - $this->table($table, function (Blueprint $table) use ($first_key, $second_key) { |
|
| 22 | + $this->table($table, function(Blueprint $table) use ($first_key, $second_key) { |
|
| 23 | 23 | $table->dropPrimary([$first_key, $second_key]); |
| 24 | 24 | |
| 25 | 25 | $table->index($first_key); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | protected function revertIndexes(string $table, string $first_key, string $second_key) |
| 30 | 30 | { |
| 31 | - $this->table($table, function (Blueprint $table) use ($first_key, $second_key) { |
|
| 31 | + $this->table($table, function(Blueprint $table) use ($first_key, $second_key) { |
|
| 32 | 32 | $table->dropIndex([$first_key]); |
| 33 | 33 | |
| 34 | 34 | $table->primary([$first_key, $second_key]); |