@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | | |
14 | 14 | */ |
15 | 15 | |
16 | -Route::group(['prefix' => 'users'], function () { |
|
16 | +Route::group(['prefix' => 'users'], function() { |
|
17 | 17 | |
18 | 18 | Route::get('/', 'UserController@index'); |
19 | 19 | Route::get('{id}', 'UserController@show'); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | Route::patch('unblock/{id}', 'UserController@unblock'); |
26 | 26 | Route::patch('assign/roles/{id}', 'UserController@assignRoles'); |
27 | 27 | |
28 | - Route::group(['prefix' => 'account'], function () { |
|
28 | + Route::group(['prefix' => 'account'], function() { |
|
29 | 29 | |
30 | 30 | Route::get('my', 'UserController@account'); |
31 | 31 | Route::get('logout', 'UserController@logout'); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('permissions', function (Blueprint $table) { |
|
15 | + Schema::create('permissions', function(Blueprint $table) { |
|
16 | 16 | increments('id'); |
17 | 17 | $table->string('name', 100); |
18 | 18 | $table->string('model', 100); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $table->timestamps(); |
21 | 21 | $table->unique(array('name', 'model')); |
22 | 22 | }); |
23 | - Schema::create('permission_role', function (Blueprint $table) { |
|
23 | + Schema::create('permission_role', function(Blueprint $table) { |
|
24 | 24 | increments('id'); |
25 | 25 | $table->unsignedInteger('role_id'); |
26 | 26 | $table->unsignedInteger('permission_id'); |
@@ -12,14 +12,14 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('roles', function (Blueprint $table) { |
|
15 | + Schema::create('roles', function(Blueprint $table) { |
|
16 | 16 | increments('id'); |
17 | 17 | $table->string('name', 100)->unique(); |
18 | 18 | $table->softDeletes(); |
19 | 19 | $table->timestamps(); |
20 | 20 | }); |
21 | 21 | |
22 | - Schema::create('role_user', function (Blueprint $table) { |
|
22 | + Schema::create('role_user', function(Blueprint $table) { |
|
23 | 23 | increments('id'); |
24 | 24 | $table->unsignedInteger('user_id'); |
25 | 25 | $table->unsignedInteger('role_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('jobs', function (Blueprint $table) { |
|
16 | + Schema::create('jobs', function(Blueprint $table) { |
|
17 | 17 | $table->bigincrements('id')->primary(); |
18 | 18 | $table->string('queue'); |
19 | 19 | $table->longText('payload'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
16 | + Schema::create('failed_jobs', function(Blueprint $table) { |
|
17 | 17 | $table->bigincrements('id')->primary(); |
18 | 18 | $table->text('connection'); |
19 | 19 | $table->text('queue'); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('push_notification_devices', function (Blueprint $table) { |
|
15 | + Schema::create('push_notification_devices', function(Blueprint $table) { |
|
16 | 16 | increments('id'); |
17 | 17 | $table->string('device_token'); |
18 | 18 | $table->unsignedInteger('user_id'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('oauth_personal_access_clients', function (Blueprint $table) { |
|
16 | + Schema::create('oauth_personal_access_clients', function(Blueprint $table) { |
|
17 | 17 | increments('id'); |
18 | 18 | $table->unsignedInteger('client_id'); |
19 | 19 | $table->timestamps(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('oauth_clients', function (Blueprint $table) { |
|
16 | + Schema::create('oauth_clients', function(Blueprint $table) { |
|
17 | 17 | increments('id'); |
18 | 18 | $table->unsignedInteger('user_id')->nullable(); |
19 | 19 | $table->string('name'); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | $permission = $routeActions[1]; |
57 | 57 | |
58 | 58 | $this->auth->shouldUse('api'); |
59 | - if (! in_array($permission, $skipLoginCheck)) { |
|
60 | - $this->authMiddleware->handle($request, function ($request) use ($modelName, $skipPermissionCheck, $permission) { |
|
59 | + if ( ! in_array($permission, $skipLoginCheck)) { |
|
60 | + $this->authMiddleware->handle($request, function($request) use ($modelName, $skipPermissionCheck, $permission) { |
|
61 | 61 | $user = $this->auth->user(); |
62 | 62 | $isPasswordClient = $user->token()->client->password_client; |
63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | if ($isPasswordClient && (in_array($permission, $skipPermissionCheck) || $this->userService->can($permission, $modelName))) { |
69 | - } elseif (! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
69 | + } elseif ( ! $isPasswordClient && $user->tokenCan($modelName.'-'.$permission)) { |
|
70 | 70 | } else { |
71 | 71 | \Errors::noPermissions(); |
72 | 72 | } |