@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | protected function getArguments() |
51 | 51 | { |
52 | 52 | return [ |
53 | - ['example', InputArgument::REQUIRED, 'An example argument.'], |
|
53 | + [ 'example', InputArgument::REQUIRED, 'An example argument.' ], |
|
54 | 54 | ]; |
55 | 55 | } |
56 | 56 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | protected function getOptions() |
63 | 63 | { |
64 | 64 | return [ |
65 | - ['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null], |
|
65 | + [ 'example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null ], |
|
66 | 66 | ]; |
67 | 67 | } |
68 | 68 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /** |
38 | 38 | * @var array |
39 | 39 | */ |
40 | - protected $guarded = []; |
|
40 | + protected $guarded = [ ]; |
|
41 | 41 | |
42 | 42 | protected $casts = [ |
43 | 43 | 'monitor' => 'boolean', |
@@ -13,9 +13,9 @@ |
||
13 | 13 | |
14 | 14 | use Modules\Authorization\Entities\Permission; |
15 | 15 | |
16 | -Route::get('/{id}', 'ProxyController@show')->middleware(['permission:'.Permission::SHOW_PROXY]); |
|
17 | -Route::patch('/{id}', 'ProxyController@update')->middleware(['permission:'.Permission::UPDATE_PROXY]); |
|
18 | -Route::delete('/{id}', 'ProxyController@destroy')->middleware(['permission:'.Permission::DELETE_PROXY]); |
|
16 | +Route::get('/{id}', 'ProxyController@show')->middleware([ 'permission:'.Permission::SHOW_PROXY ]); |
|
17 | +Route::patch('/{id}', 'ProxyController@update')->middleware([ 'permission:'.Permission::UPDATE_PROXY ]); |
|
18 | +Route::delete('/{id}', 'ProxyController@destroy')->middleware([ 'permission:'.Permission::DELETE_PROXY ]); |
|
19 | 19 | |
20 | -Route::post('/', 'ProxyController@store')->middleware(['permission:'.Permission::CREATE_PROXY]); |
|
21 | -Route::get('/', 'ProxyController@index')->middleware(['permission:'.Permission::INDEX_PROXY]); |
|
20 | +Route::post('/', 'ProxyController@store')->middleware([ 'permission:'.Permission::CREATE_PROXY ]); |
|
21 | +Route::get('/', 'ProxyController@index')->middleware([ 'permission:'.Permission::INDEX_PROXY ]); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | |
17 | 17 | class ProxyUpdatedEvent extends Event implements ShouldBroadcast |
18 | 18 | { |
19 | - public $listeners = []; |
|
19 | + public $listeners = [ ]; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var proxy |
@@ -13,8 +13,8 @@ |
||
13 | 13 | |
14 | 14 | use Modules\Authorization\Entities\Permission; |
15 | 15 | |
16 | -Route::get('/{id}', 'ScheduleController@show')->middleware(['permission:'.Permission::SHOW_SCHEDULE]); |
|
17 | -Route::patch('/{id}', 'ScheduleController@update')->middleware(['permission:'.Permission::UPDATE_SCHEDULE]); |
|
18 | -Route::delete('/{id}', 'ScheduleController@destroy')->middleware(['permission:'.Permission::DELETE_SCHEDULE]); |
|
19 | -Route::post('/', 'ScheduleController@store')->middleware(['permission:'.Permission::CREATE_SCHEDULE]); |
|
20 | -Route::get('/', 'ScheduleController@index')->middleware(['permission:'.Permission::INDEX_SCHEDULE]); |
|
16 | +Route::get('/{id}', 'ScheduleController@show')->middleware([ 'permission:'.Permission::SHOW_SCHEDULE ]); |
|
17 | +Route::patch('/{id}', 'ScheduleController@update')->middleware([ 'permission:'.Permission::UPDATE_SCHEDULE ]); |
|
18 | +Route::delete('/{id}', 'ScheduleController@destroy')->middleware([ 'permission:'.Permission::DELETE_SCHEDULE ]); |
|
19 | +Route::post('/', 'ScheduleController@store')->middleware([ 'permission:'.Permission::CREATE_SCHEDULE ]); |
|
20 | +Route::get('/', 'ScheduleController@index')->middleware([ 'permission:'.Permission::INDEX_SCHEDULE ]); |
@@ -49,17 +49,17 @@ |
||
49 | 49 | |
50 | 50 | public function getUserByUserInfo($userInfo) |
51 | 51 | { |
52 | - return $this->upsertUser($userInfo['profile']); |
|
52 | + return $this->upsertUser($userInfo[ 'profile' ]); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | protected function upsertUser($profile) |
56 | 56 | { |
57 | - if (! isset($profile->user_id)) { |
|
57 | + if (!isset($profile->user_id)) { |
|
58 | 58 | throw new BadRequestHttpException('Missing token information: Auth0 user id is not set'); |
59 | 59 | } |
60 | 60 | $identifier = explode('|', $profile->user_id); |
61 | - $identityProvider = $identifier[0]; |
|
62 | - $id = $identifier[1]; |
|
61 | + $identityProvider = $identifier[ 0 ]; |
|
62 | + $id = $identifier[ 1 ]; |
|
63 | 63 | |
64 | 64 | $user = $this->service->findByIdentityId($id); |
65 | 65 | if ($user === null) { |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function handle() |
30 | 30 | { |
31 | - if (! $this->confirmToProceed()) { |
|
31 | + if (!$this->confirmToProceed()) { |
|
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->resolver->setDefaultConnection($this->getDatabase()); |
36 | 36 | |
37 | - Model::unguarded(function () { |
|
37 | + Model::unguarded(function() { |
|
38 | 38 | foreach ($this->getSeeders() as $seeder) { |
39 | - $seeder = $this->laravel->make($seeder['class']); |
|
40 | - if (! isset($seeder->enabled) || $seeder->enabled) { |
|
39 | + $seeder = $this->laravel->make($seeder[ 'class' ]); |
|
40 | + if (!isset($seeder->enabled) || $seeder->enabled) { |
|
41 | 41 | $seeder->__invoke(); |
42 | 42 | } |
43 | 43 | } |
@@ -50,6 +50,6 @@ discard block |
||
50 | 50 | { |
51 | 51 | $this->service = $this->laravel->make(BootstrapRegistrarService::class); |
52 | 52 | |
53 | - return $this->service->getSeeders() ?? []; |
|
53 | + return $this->service->getSeeders() ?? [ ]; |
|
54 | 54 | } |
55 | 55 | } |
@@ -161,7 +161,7 @@ |
||
161 | 161 | |
162 | 162 | public function getNamespace(): string |
163 | 163 | { |
164 | - return 'Modules' . '\\' . $this->getName(); |
|
164 | + return 'Modules'.'\\'.$this->getName(); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | public function getMainModel() |
@@ -16,71 +16,71 @@ discard block |
||
16 | 16 | $tableNames = config('permission.table_names'); |
17 | 17 | $columnNames = config('permission.column_names'); |
18 | 18 | |
19 | - Schema::create($tableNames['permissions'], function (Blueprint $table) { |
|
19 | + Schema::create($tableNames[ 'permissions' ], function(Blueprint $table) { |
|
20 | 20 | $table->increments('id'); |
21 | 21 | $table->string('name'); |
22 | 22 | $table->string('guard_name'); |
23 | 23 | $table->timestamps(); |
24 | 24 | }); |
25 | 25 | |
26 | - Schema::create($tableNames['roles'], function (Blueprint $table) { |
|
26 | + Schema::create($tableNames[ 'roles' ], function(Blueprint $table) { |
|
27 | 27 | $table->increments('id'); |
28 | 28 | $table->string('name'); |
29 | 29 | $table->string('guard_name'); |
30 | 30 | $table->timestamps(); |
31 | 31 | }); |
32 | 32 | |
33 | - Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { |
|
33 | + Schema::create($tableNames[ 'model_has_permissions' ], function(Blueprint $table) use ($tableNames, $columnNames) { |
|
34 | 34 | $table->unsignedInteger('permission_id'); |
35 | 35 | |
36 | 36 | $table->string('model_type'); |
37 | - $table->unsignedBigInteger($columnNames['model_morph_key']); |
|
38 | - $table->index([$columnNames['model_morph_key'], 'model_type']); |
|
37 | + $table->unsignedBigInteger($columnNames[ 'model_morph_key' ]); |
|
38 | + $table->index([ $columnNames[ 'model_morph_key' ], 'model_type' ]); |
|
39 | 39 | |
40 | 40 | $table->foreign('permission_id') |
41 | 41 | ->references('id') |
42 | - ->on($tableNames['permissions']) |
|
42 | + ->on($tableNames[ 'permissions' ]) |
|
43 | 43 | ->onDelete('cascade'); |
44 | 44 | |
45 | 45 | $table->primary( |
46 | - ['permission_id', $columnNames['model_morph_key'], 'model_type'], |
|
46 | + [ 'permission_id', $columnNames[ 'model_morph_key' ], 'model_type' ], |
|
47 | 47 | 'model_has_permissions_permission_model_type_primary' |
48 | 48 | ); |
49 | 49 | }); |
50 | 50 | |
51 | - Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { |
|
51 | + Schema::create($tableNames[ 'model_has_roles' ], function(Blueprint $table) use ($tableNames, $columnNames) { |
|
52 | 52 | $table->unsignedInteger('role_id'); |
53 | 53 | |
54 | 54 | $table->string('model_type'); |
55 | - $table->unsignedBigInteger($columnNames['model_morph_key']); |
|
56 | - $table->index([$columnNames['model_morph_key'], 'model_type']); |
|
55 | + $table->unsignedBigInteger($columnNames[ 'model_morph_key' ]); |
|
56 | + $table->index([ $columnNames[ 'model_morph_key' ], 'model_type' ]); |
|
57 | 57 | |
58 | 58 | $table->foreign('role_id') |
59 | 59 | ->references('id') |
60 | - ->on($tableNames['roles']) |
|
60 | + ->on($tableNames[ 'roles' ]) |
|
61 | 61 | ->onDelete('cascade'); |
62 | 62 | |
63 | 63 | $table->primary( |
64 | - ['role_id', $columnNames['model_morph_key'], 'model_type'], |
|
64 | + [ 'role_id', $columnNames[ 'model_morph_key' ], 'model_type' ], |
|
65 | 65 | 'model_has_roles_role_model_type_primary' |
66 | 66 | ); |
67 | 67 | }); |
68 | 68 | |
69 | - Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { |
|
69 | + Schema::create($tableNames[ 'role_has_permissions' ], function(Blueprint $table) use ($tableNames) { |
|
70 | 70 | $table->unsignedInteger('permission_id'); |
71 | 71 | $table->unsignedInteger('role_id'); |
72 | 72 | |
73 | 73 | $table->foreign('permission_id') |
74 | 74 | ->references('id') |
75 | - ->on($tableNames['permissions']) |
|
75 | + ->on($tableNames[ 'permissions' ]) |
|
76 | 76 | ->onDelete('cascade'); |
77 | 77 | |
78 | 78 | $table->foreign('role_id') |
79 | 79 | ->references('id') |
80 | - ->on($tableNames['roles']) |
|
80 | + ->on($tableNames[ 'roles' ]) |
|
81 | 81 | ->onDelete('cascade'); |
82 | 82 | |
83 | - $table->primary(['permission_id', 'role_id']); |
|
83 | + $table->primary([ 'permission_id', 'role_id' ]); |
|
84 | 84 | |
85 | 85 | app('cache')->forget('spatie.permission.cache'); |
86 | 86 | }); |
@@ -95,10 +95,10 @@ discard block |
||
95 | 95 | { |
96 | 96 | $tableNames = config('permission.table_names'); |
97 | 97 | |
98 | - Schema::drop($tableNames['role_has_permissions']); |
|
99 | - Schema::drop($tableNames['model_has_roles']); |
|
100 | - Schema::drop($tableNames['model_has_permissions']); |
|
101 | - Schema::drop($tableNames['roles']); |
|
102 | - Schema::drop($tableNames['permissions']); |
|
98 | + Schema::drop($tableNames[ 'role_has_permissions' ]); |
|
99 | + Schema::drop($tableNames[ 'model_has_roles' ]); |
|
100 | + Schema::drop($tableNames[ 'model_has_permissions' ]); |
|
101 | + Schema::drop($tableNames[ 'roles' ]); |
|
102 | + Schema::drop($tableNames[ 'permissions' ]); |
|
103 | 103 | } |
104 | 104 | } |