@@ -6,30 +6,30 @@ |
||
6 | 6 | |
7 | 7 | class CreateFailedJobsTable extends Migration |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the migrations. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function up() |
|
15 | - { |
|
16 | - Schema::create('failed_jobs', function (Blueprint $table) { |
|
17 | - $table->increments('id'); |
|
18 | - $table->text('connection'); |
|
19 | - $table->text('queue'); |
|
20 | - $table->longText('payload'); |
|
21 | - $table->longText('exception'); |
|
22 | - $table->timestamp('failed_at')->useCurrent(); |
|
23 | - }); |
|
24 | - } |
|
9 | + /** |
|
10 | + * Run the migrations. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function up() |
|
15 | + { |
|
16 | + Schema::create('failed_jobs', function (Blueprint $table) { |
|
17 | + $table->increments('id'); |
|
18 | + $table->text('connection'); |
|
19 | + $table->text('queue'); |
|
20 | + $table->longText('payload'); |
|
21 | + $table->longText('exception'); |
|
22 | + $table->timestamp('failed_at')->useCurrent(); |
|
23 | + }); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Reverse the migrations. |
|
28 | - * |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function down() |
|
32 | - { |
|
33 | - Schema::dropIfExists('failed_jobs'); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Reverse the migrations. |
|
28 | + * |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function down() |
|
32 | + { |
|
33 | + Schema::dropIfExists('failed_jobs'); |
|
34 | + } |
|
35 | 35 | } |
@@ -8,82 +8,82 @@ |
||
8 | 8 | |
9 | 9 | class UsersTableSeeder extends Seeder |
10 | 10 | { |
11 | - /** |
|
12 | - * Run the database seeds. |
|
13 | - * |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function run() |
|
17 | - { |
|
18 | - /** |
|
19 | - * Insert the permissions related to users table. |
|
20 | - */ |
|
21 | - \DB::table('permissions')->insert( |
|
22 | - [ |
|
23 | - /** |
|
24 | - * Users model permissions. |
|
25 | - */ |
|
26 | - [ |
|
27 | - 'name' => 'index', |
|
28 | - 'model' => 'user', |
|
29 | - 'created_at' => \DB::raw('NOW()'), |
|
30 | - 'updated_at' => \DB::raw('NOW()') |
|
31 | - ], |
|
32 | - [ |
|
33 | - 'name' => 'show', |
|
34 | - 'model' => 'user', |
|
35 | - 'created_at' => \DB::raw('NOW()'), |
|
36 | - 'updated_at' => \DB::raw('NOW()') |
|
37 | - ], |
|
38 | - [ |
|
39 | - 'name' => 'store', |
|
40 | - 'model' => 'user', |
|
41 | - 'created_at' => \DB::raw('NOW()'), |
|
42 | - 'updated_at' => \DB::raw('NOW()') |
|
43 | - ], |
|
44 | - [ |
|
45 | - 'name' => 'update', |
|
46 | - 'model' => 'user', |
|
47 | - 'created_at' => \DB::raw('NOW()'), |
|
48 | - 'updated_at' => \DB::raw('NOW()') |
|
49 | - ], |
|
50 | - [ |
|
51 | - 'name' => 'destroy', |
|
52 | - 'model' => 'user', |
|
53 | - 'created_at' => \DB::raw('NOW()'), |
|
54 | - 'updated_at' => \DB::raw('NOW()') |
|
55 | - ], |
|
56 | - [ |
|
57 | - 'name' => 'deleted', |
|
58 | - 'model' => 'user', |
|
59 | - 'created_at' => \DB::raw('NOW()'), |
|
60 | - 'updated_at' => \DB::raw('NOW()') |
|
61 | - ], |
|
62 | - [ |
|
63 | - 'name' => 'restore', |
|
64 | - 'model' => 'user', |
|
65 | - 'created_at' => \DB::raw('NOW()'), |
|
66 | - 'updated_at' => \DB::raw('NOW()') |
|
67 | - ], |
|
68 | - [ |
|
69 | - 'name' => 'assignRoles', |
|
70 | - 'model' => 'user', |
|
71 | - 'created_at' => \DB::raw('NOW()'), |
|
72 | - 'updated_at' => \DB::raw('NOW()') |
|
73 | - ], |
|
74 | - [ |
|
75 | - 'name' => 'block', |
|
76 | - 'model' => 'user', |
|
77 | - 'created_at' => \DB::raw('NOW()'), |
|
78 | - 'updated_at' => \DB::raw('NOW()') |
|
79 | - ], |
|
80 | - [ |
|
81 | - 'name' => 'unblock', |
|
82 | - 'model' => 'user', |
|
83 | - 'created_at' => \DB::raw('NOW()'), |
|
84 | - 'updated_at' => \DB::raw('NOW()') |
|
85 | - ] |
|
86 | - ] |
|
87 | - ); |
|
88 | - } |
|
11 | + /** |
|
12 | + * Run the database seeds. |
|
13 | + * |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function run() |
|
17 | + { |
|
18 | + /** |
|
19 | + * Insert the permissions related to users table. |
|
20 | + */ |
|
21 | + \DB::table('permissions')->insert( |
|
22 | + [ |
|
23 | + /** |
|
24 | + * Users model permissions. |
|
25 | + */ |
|
26 | + [ |
|
27 | + 'name' => 'index', |
|
28 | + 'model' => 'user', |
|
29 | + 'created_at' => \DB::raw('NOW()'), |
|
30 | + 'updated_at' => \DB::raw('NOW()') |
|
31 | + ], |
|
32 | + [ |
|
33 | + 'name' => 'show', |
|
34 | + 'model' => 'user', |
|
35 | + 'created_at' => \DB::raw('NOW()'), |
|
36 | + 'updated_at' => \DB::raw('NOW()') |
|
37 | + ], |
|
38 | + [ |
|
39 | + 'name' => 'store', |
|
40 | + 'model' => 'user', |
|
41 | + 'created_at' => \DB::raw('NOW()'), |
|
42 | + 'updated_at' => \DB::raw('NOW()') |
|
43 | + ], |
|
44 | + [ |
|
45 | + 'name' => 'update', |
|
46 | + 'model' => 'user', |
|
47 | + 'created_at' => \DB::raw('NOW()'), |
|
48 | + 'updated_at' => \DB::raw('NOW()') |
|
49 | + ], |
|
50 | + [ |
|
51 | + 'name' => 'destroy', |
|
52 | + 'model' => 'user', |
|
53 | + 'created_at' => \DB::raw('NOW()'), |
|
54 | + 'updated_at' => \DB::raw('NOW()') |
|
55 | + ], |
|
56 | + [ |
|
57 | + 'name' => 'deleted', |
|
58 | + 'model' => 'user', |
|
59 | + 'created_at' => \DB::raw('NOW()'), |
|
60 | + 'updated_at' => \DB::raw('NOW()') |
|
61 | + ], |
|
62 | + [ |
|
63 | + 'name' => 'restore', |
|
64 | + 'model' => 'user', |
|
65 | + 'created_at' => \DB::raw('NOW()'), |
|
66 | + 'updated_at' => \DB::raw('NOW()') |
|
67 | + ], |
|
68 | + [ |
|
69 | + 'name' => 'assignRoles', |
|
70 | + 'model' => 'user', |
|
71 | + 'created_at' => \DB::raw('NOW()'), |
|
72 | + 'updated_at' => \DB::raw('NOW()') |
|
73 | + ], |
|
74 | + [ |
|
75 | + 'name' => 'block', |
|
76 | + 'model' => 'user', |
|
77 | + 'created_at' => \DB::raw('NOW()'), |
|
78 | + 'updated_at' => \DB::raw('NOW()') |
|
79 | + ], |
|
80 | + [ |
|
81 | + 'name' => 'unblock', |
|
82 | + 'model' => 'user', |
|
83 | + 'created_at' => \DB::raw('NOW()'), |
|
84 | + 'updated_at' => \DB::raw('NOW()') |
|
85 | + ] |
|
86 | + ] |
|
87 | + ); |
|
88 | + } |
|
89 | 89 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | |
5 | - /* |
|
5 | + /* |
|
6 | 6 | |-------------------------------------------------------------------------- |
7 | 7 | | Disable Confirm Email |
8 | 8 | |-------------------------------------------------------------------------- |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | - 'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', true), |
|
14 | + 'disable_confirm_email' => env('DISABLE_CONFIRM_EMAIL', true), |
|
15 | 15 | |
16 | - /* |
|
16 | + /* |
|
17 | 17 | |-------------------------------------------------------------------------- |
18 | 18 | | Confirm Email URL |
19 | 19 | |-------------------------------------------------------------------------- |
@@ -22,9 +22,9 @@ discard block |
||
22 | 22 | | |
23 | 23 | */ |
24 | 24 | |
25 | - 'confrim_email_url' => env('CONFIRM_EMAIL_URL'), |
|
25 | + 'confrim_email_url' => env('CONFIRM_EMAIL_URL'), |
|
26 | 26 | |
27 | - /* |
|
27 | + /* |
|
28 | 28 | |-------------------------------------------------------------------------- |
29 | 29 | | Reset Password URL |
30 | 30 | |-------------------------------------------------------------------------- |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | | |
34 | 34 | */ |
35 | 35 | |
36 | - 'reset_password_url' => env('RESET_PASSWORD_URL'), |
|
36 | + 'reset_password_url' => env('RESET_PASSWORD_URL'), |
|
37 | 37 | |
38 | - /* |
|
38 | + /* |
|
39 | 39 | |-------------------------------------------------------------------------- |
40 | 40 | | Passport Client Id |
41 | 41 | |-------------------------------------------------------------------------- |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | | |
45 | 45 | */ |
46 | 46 | |
47 | - 'passport_client_id' => env('PASSWORD_CLIENT_ID'), |
|
47 | + 'passport_client_id' => env('PASSWORD_CLIENT_ID'), |
|
48 | 48 | |
49 | - /* |
|
49 | + /* |
|
50 | 50 | |-------------------------------------------------------------------------- |
51 | 51 | | Passport Client Secret |
52 | 52 | |-------------------------------------------------------------------------- |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | | |
56 | 56 | */ |
57 | 57 | |
58 | - 'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'), |
|
58 | + 'passport_client_secret' => env('PASSWORD_CLIENT_SECRET'), |
|
59 | 59 | |
60 | - /* |
|
60 | + /* |
|
61 | 61 | |-------------------------------------------------------------------------- |
62 | 62 | | Token Expire In |
63 | 63 | |-------------------------------------------------------------------------- |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | | |
67 | 67 | */ |
68 | 68 | |
69 | - /* |
|
69 | + /* |
|
70 | 70 | |-------------------------------------------------------------------------- |
71 | 71 | | Social Pass |
72 | 72 | |-------------------------------------------------------------------------- |
@@ -75,5 +75,5 @@ discard block |
||
75 | 75 | | |
76 | 76 | */ |
77 | 77 | |
78 | - 'social_pass' => env('SOCIAL_PASS', false), |
|
78 | + 'social_pass' => env('SOCIAL_PASS', false), |
|
79 | 79 | ]; |
@@ -7,69 +7,69 @@ |
||
7 | 7 | */ |
8 | 8 | class RoleObserver |
9 | 9 | { |
10 | - public function saving($model) |
|
11 | - { |
|
12 | - // |
|
13 | - } |
|
10 | + public function saving($model) |
|
11 | + { |
|
12 | + // |
|
13 | + } |
|
14 | 14 | |
15 | - public function saved($model) |
|
16 | - { |
|
17 | - // |
|
18 | - } |
|
15 | + public function saved($model) |
|
16 | + { |
|
17 | + // |
|
18 | + } |
|
19 | 19 | |
20 | - public function creating($model) |
|
21 | - { |
|
22 | - // |
|
23 | - } |
|
20 | + public function creating($model) |
|
21 | + { |
|
22 | + // |
|
23 | + } |
|
24 | 24 | |
25 | - public function created($model) |
|
26 | - { |
|
27 | - // |
|
28 | - } |
|
25 | + public function created($model) |
|
26 | + { |
|
27 | + // |
|
28 | + } |
|
29 | 29 | |
30 | - /** |
|
31 | - * Prevent updating of the admin role. |
|
32 | - * |
|
33 | - * @param object $model the model beign updated. |
|
34 | - * @return void |
|
35 | - */ |
|
36 | - public function updating($model) |
|
37 | - { |
|
38 | - if ($model->getOriginal('name') == RoleEnum::ADMIN) { |
|
39 | - \Errors::noPermissions(); |
|
40 | - } |
|
41 | - } |
|
30 | + /** |
|
31 | + * Prevent updating of the admin role. |
|
32 | + * |
|
33 | + * @param object $model the model beign updated. |
|
34 | + * @return void |
|
35 | + */ |
|
36 | + public function updating($model) |
|
37 | + { |
|
38 | + if ($model->getOriginal('name') == RoleEnum::ADMIN) { |
|
39 | + \Errors::noPermissions(); |
|
40 | + } |
|
41 | + } |
|
42 | 42 | |
43 | - public function updated($model) |
|
44 | - { |
|
45 | - // |
|
46 | - } |
|
43 | + public function updated($model) |
|
44 | + { |
|
45 | + // |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * Prevent deleting the admin role. |
|
50 | - * |
|
51 | - * @param object $model the delted model. |
|
52 | - * @return void |
|
53 | - */ |
|
54 | - public function deleting($model) |
|
55 | - { |
|
56 | - if ($model->getOriginal('name') == RoleEnum::ADMIN) { |
|
57 | - \Errors::noPermissions(); |
|
58 | - } |
|
59 | - } |
|
48 | + /** |
|
49 | + * Prevent deleting the admin role. |
|
50 | + * |
|
51 | + * @param object $model the delted model. |
|
52 | + * @return void |
|
53 | + */ |
|
54 | + public function deleting($model) |
|
55 | + { |
|
56 | + if ($model->getOriginal('name') == RoleEnum::ADMIN) { |
|
57 | + \Errors::noPermissions(); |
|
58 | + } |
|
59 | + } |
|
60 | 60 | |
61 | - public function deleted($model) |
|
62 | - { |
|
63 | - // |
|
64 | - } |
|
61 | + public function deleted($model) |
|
62 | + { |
|
63 | + // |
|
64 | + } |
|
65 | 65 | |
66 | - public function restoring($model) |
|
67 | - { |
|
68 | - // |
|
69 | - } |
|
66 | + public function restoring($model) |
|
67 | + { |
|
68 | + // |
|
69 | + } |
|
70 | 70 | |
71 | - public function restored($model) |
|
72 | - { |
|
73 | - // |
|
74 | - } |
|
71 | + public function restored($model) |
|
72 | + { |
|
73 | + // |
|
74 | + } |
|
75 | 75 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | class RoleEnum |
6 | 6 | { |
7 | - const ADMIN = 'Admin'; |
|
7 | + const ADMIN = 'Admin'; |
|
8 | 8 | } |
@@ -7,63 +7,63 @@ |
||
7 | 7 | |
8 | 8 | class OauthClientService extends BaseService |
9 | 9 | { |
10 | - /** |
|
11 | - * Init new object. |
|
12 | - * |
|
13 | - * @param OauthClientRepository $repo |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function __construct(OauthClientRepository $repo) |
|
17 | - { |
|
18 | - parent::__construct($repo); |
|
19 | - } |
|
10 | + /** |
|
11 | + * Init new object. |
|
12 | + * |
|
13 | + * @param OauthClientRepository $repo |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function __construct(OauthClientRepository $repo) |
|
17 | + { |
|
18 | + parent::__construct($repo); |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * Revoke the given client. |
|
23 | - * |
|
24 | - * @param integer $clientId |
|
25 | - * @return void |
|
26 | - */ |
|
27 | - public function revoke($clientId) |
|
28 | - { |
|
29 | - \DB::transaction(function () use ($clientId) { |
|
30 | - $client = $this->repo->find($clientId); |
|
31 | - $this->repo->revokeClientTokens($client); |
|
32 | - $this->repo->save(['id'=> $clientId, 'revoked' => true]); |
|
33 | - }); |
|
34 | - } |
|
21 | + /** |
|
22 | + * Revoke the given client. |
|
23 | + * |
|
24 | + * @param integer $clientId |
|
25 | + * @return void |
|
26 | + */ |
|
27 | + public function revoke($clientId) |
|
28 | + { |
|
29 | + \DB::transaction(function () use ($clientId) { |
|
30 | + $client = $this->repo->find($clientId); |
|
31 | + $this->repo->revokeClientTokens($client); |
|
32 | + $this->repo->save(['id'=> $clientId, 'revoked' => true]); |
|
33 | + }); |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
37 | - * UnRevoke the given client. |
|
38 | - * |
|
39 | - * @param integer $clientId |
|
40 | - * @return void |
|
41 | - */ |
|
42 | - public function unRevoke($clientId) |
|
43 | - { |
|
44 | - $this->repo->save(['id'=> $clientId, 'revoked' => false]); |
|
45 | - } |
|
36 | + /** |
|
37 | + * UnRevoke the given client. |
|
38 | + * |
|
39 | + * @param integer $clientId |
|
40 | + * @return void |
|
41 | + */ |
|
42 | + public function unRevoke($clientId) |
|
43 | + { |
|
44 | + $this->repo->save(['id'=> $clientId, 'revoked' => false]); |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * Ensure access token hasn't expired or revoked. |
|
49 | - * |
|
50 | - * @param string $accessToken |
|
51 | - * @return boolean |
|
52 | - */ |
|
53 | - public function accessTokenExpiredOrRevoked($accessToken) |
|
54 | - { |
|
55 | - return $this->repo->accessTokenExpiredOrRevoked($accessToken); |
|
56 | - } |
|
47 | + /** |
|
48 | + * Ensure access token hasn't expired or revoked. |
|
49 | + * |
|
50 | + * @param string $accessToken |
|
51 | + * @return boolean |
|
52 | + */ |
|
53 | + public function accessTokenExpiredOrRevoked($accessToken) |
|
54 | + { |
|
55 | + return $this->repo->accessTokenExpiredOrRevoked($accessToken); |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * Revoke the given access token and all |
|
60 | - * associated refresh tokens. |
|
61 | - * |
|
62 | - * @param oject $accessToken |
|
63 | - * @return void |
|
64 | - */ |
|
65 | - public function revokeAccessToken($accessToken) |
|
66 | - { |
|
67 | - return $this->repo->revokeAccessToken($accessToken); |
|
68 | - } |
|
58 | + /** |
|
59 | + * Revoke the given access token and all |
|
60 | + * associated refresh tokens. |
|
61 | + * |
|
62 | + * @param oject $accessToken |
|
63 | + * @return void |
|
64 | + */ |
|
65 | + public function revokeAccessToken($accessToken) |
|
66 | + { |
|
67 | + return $this->repo->revokeAccessToken($accessToken); |
|
68 | + } |
|
69 | 69 | } |
@@ -6,26 +6,26 @@ |
||
6 | 6 | |
7 | 7 | class StoreRole extends FormRequest |
8 | 8 | { |
9 | - /** |
|
10 | - * Determine if the user is authorized to make this request. |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function authorize() |
|
15 | - { |
|
16 | - return true; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Determine if the user is authorized to make this request. |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function authorize() |
|
15 | + { |
|
16 | + return true; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Get the validation rules that apply to the request. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function rules() |
|
25 | - { |
|
26 | - $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | - return [ |
|
28 | - 'name' => $requiredOrNullable . '|string|max:100|unique:roles,name,' . $this->route('id') |
|
29 | - ]; |
|
30 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | + return [ |
|
28 | + 'name' => $requiredOrNullable . '|string|max:100|unique:roles,name,' . $this->route('id') |
|
29 | + ]; |
|
30 | + } |
|
31 | 31 | } |
@@ -6,29 +6,29 @@ |
||
6 | 6 | |
7 | 7 | class StoreOauthClient extends FormRequest |
8 | 8 | { |
9 | - /** |
|
10 | - * Determine if the user is authorized to make this request. |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function authorize() |
|
15 | - { |
|
16 | - return true; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Determine if the user is authorized to make this request. |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function authorize() |
|
15 | + { |
|
16 | + return true; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Get the validation rules that apply to the request. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function rules() |
|
25 | - { |
|
26 | - $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | - return [ |
|
28 | - 'name' => $requiredOrNullable . '|max:255', |
|
29 | - 'redirect' => $requiredOrNullable . '|url', |
|
30 | - 'user_id' => $requiredOrNullable . '|exists:users,id', |
|
31 | - 'revoked' => 'boolean' |
|
32 | - ]; |
|
33 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | + return [ |
|
28 | + 'name' => $requiredOrNullable . '|max:255', |
|
29 | + 'redirect' => $requiredOrNullable . '|url', |
|
30 | + 'user_id' => $requiredOrNullable . '|exists:users,id', |
|
31 | + 'revoked' => 'boolean' |
|
32 | + ]; |
|
33 | + } |
|
34 | 34 | } |
@@ -6,28 +6,28 @@ |
||
6 | 6 | |
7 | 7 | class StoreUser extends FormRequest |
8 | 8 | { |
9 | - /** |
|
10 | - * Determine if the user is authorized to make this request. |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function authorize() |
|
15 | - { |
|
16 | - return true; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Determine if the user is authorized to make this request. |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function authorize() |
|
15 | + { |
|
16 | + return true; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Get the validation rules that apply to the request. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function rules() |
|
25 | - { |
|
26 | - $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | - return [ |
|
28 | - 'name' => 'nullable|string', |
|
29 | - 'email' => $requiredOrNullable . '|email|unique:users,email,' . $this->route('id'), |
|
30 | - 'password' => 'nullable|min:6' |
|
31 | - ]; |
|
32 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | + return [ |
|
28 | + 'name' => 'nullable|string', |
|
29 | + 'email' => $requiredOrNullable . '|email|unique:users,email,' . $this->route('id'), |
|
30 | + 'password' => 'nullable|min:6' |
|
31 | + ]; |
|
32 | + } |
|
33 | 33 | } |