@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class AssignRelationsSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $adminGroupId = \DB::table('groups')->where('name', 'admin')->select('id')->first()->id; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Assign the permissions to the admin group. |
|
20 | - */ |
|
21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminGroupId) { |
|
22 | - \DB::table('groups_permissions')->insert( |
|
23 | - [ |
|
24 | - 'permission_id' => $permission->id, |
|
25 | - 'group_id' => $adminGroupId, |
|
26 | - 'created_at' => \DB::raw('NOW()'), |
|
27 | - 'updated_at' => \DB::raw('NOW()') |
|
28 | - ] |
|
29 | - ); |
|
30 | - }); |
|
31 | - } |
|
18 | + /** |
|
19 | + * Assign the permissions to the admin group. |
|
20 | + */ |
|
21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminGroupId) { |
|
22 | + \DB::table('groups_permissions')->insert( |
|
23 | + [ |
|
24 | + 'permission_id' => $permission->id, |
|
25 | + 'group_id' => $adminGroupId, |
|
26 | + 'created_at' => \DB::raw('NOW()'), |
|
27 | + 'updated_at' => \DB::raw('NOW()') |
|
28 | + ] |
|
29 | + ); |
|
30 | + }); |
|
31 | + } |
|
32 | 32 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * Assign the permissions to the admin group. |
20 | 20 | */ |
21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminGroupId) { |
|
21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function($permission) use ($adminGroupId) { |
|
22 | 22 | \DB::table('groups_permissions')->insert( |
23 | 23 | [ |
24 | 24 | 'permission_id' => $permission->id, |
@@ -6,15 +6,15 @@ |
||
6 | 6 | |
7 | 7 | class ClearDataSeeder extends Seeder |
8 | 8 | { |
9 | - /** |
|
10 | - * Run the database seeds. |
|
11 | - * |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function run() |
|
15 | - { |
|
16 | - $permissions = \DB::table('permissions')->whereIn('model', ['user']); |
|
17 | - \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | - $permissions->delete(); |
|
19 | - } |
|
9 | + /** |
|
10 | + * Run the database seeds. |
|
11 | + * |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function run() |
|
15 | + { |
|
16 | + $permissions = \DB::table('permissions')->whereIn('model', ['user']); |
|
17 | + \DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
18 | + $permissions->delete(); |
|
19 | + } |
|
20 | 20 | } |
@@ -5,51 +5,51 @@ |
||
5 | 5 | |
6 | 6 | class Users extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('users', function (Blueprint $table) { |
|
16 | - $table->increments('id'); |
|
17 | - $table->string('profile_picture', 150)->nullable(); |
|
18 | - $table->string('name', 100)->nullable(); |
|
19 | - $table->string('email')->unique(); |
|
20 | - $table->string('password', 60)->nullable(); |
|
21 | - $table->boolean('blocked')->default(0); |
|
22 | - $table->boolean('confirmed')->default(0); |
|
23 | - $table->string('confirmation_code')->nullable(); |
|
24 | - $table->string('locale', 2)->default('en'); |
|
25 | - $table->string('timezone', 50)->default('Africa/Cairo'); |
|
26 | - $table->softDeletes(); |
|
27 | - $table->rememberToken(); |
|
28 | - $table->timestamps(); |
|
29 | - }); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('users', function (Blueprint $table) { |
|
16 | + $table->increments('id'); |
|
17 | + $table->string('profile_picture', 150)->nullable(); |
|
18 | + $table->string('name', 100)->nullable(); |
|
19 | + $table->string('email')->unique(); |
|
20 | + $table->string('password', 60)->nullable(); |
|
21 | + $table->boolean('blocked')->default(0); |
|
22 | + $table->boolean('confirmed')->default(0); |
|
23 | + $table->string('confirmation_code')->nullable(); |
|
24 | + $table->string('locale', 2)->default('en'); |
|
25 | + $table->string('timezone', 50)->default('Africa/Cairo'); |
|
26 | + $table->softDeletes(); |
|
27 | + $table->rememberToken(); |
|
28 | + $table->timestamps(); |
|
29 | + }); |
|
30 | 30 | |
31 | - /** |
|
32 | - * Create Default users. |
|
33 | - */ |
|
34 | - \DB::table('users')->insertGetId( |
|
35 | - [ |
|
36 | - 'name' => 'Admin', |
|
37 | - 'email' => '[email protected]', |
|
38 | - 'password' => bcrypt('123456'), |
|
39 | - 'confirmed' => 1, |
|
40 | - 'created_at' => \DB::raw('NOW()'), |
|
41 | - 'updated_at' => \DB::raw('NOW()') |
|
42 | - ] |
|
43 | - ); |
|
44 | - } |
|
31 | + /** |
|
32 | + * Create Default users. |
|
33 | + */ |
|
34 | + \DB::table('users')->insertGetId( |
|
35 | + [ |
|
36 | + 'name' => 'Admin', |
|
37 | + 'email' => '[email protected]', |
|
38 | + 'password' => bcrypt('123456'), |
|
39 | + 'confirmed' => 1, |
|
40 | + 'created_at' => \DB::raw('NOW()'), |
|
41 | + 'updated_at' => \DB::raw('NOW()') |
|
42 | + ] |
|
43 | + ); |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * Reverse the migrations. |
|
48 | - * |
|
49 | - * @return void |
|
50 | - */ |
|
51 | - public function down() |
|
52 | - { |
|
53 | - Schema::dropIfExists('users'); |
|
54 | - } |
|
46 | + /** |
|
47 | + * Reverse the migrations. |
|
48 | + * |
|
49 | + * @return void |
|
50 | + */ |
|
51 | + public function down() |
|
52 | + { |
|
53 | + Schema::dropIfExists('users'); |
|
54 | + } |
|
55 | 55 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('users', function (Blueprint $table) { |
|
15 | + Schema::create('users', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('profile_picture', 150)->nullable(); |
18 | 18 | $table->string('name', 100)->nullable(); |
@@ -5,27 +5,27 @@ |
||
5 | 5 | |
6 | 6 | class PasswordResets extends Migration |
7 | 7 | { |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('password_resets', function (Blueprint $table) { |
|
16 | - $table->string('email')->index(); |
|
17 | - $table->string('token')->index(); |
|
18 | - $table->timestamp('created_at'); |
|
19 | - }); |
|
20 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('password_resets', function (Blueprint $table) { |
|
16 | + $table->string('email')->index(); |
|
17 | + $table->string('token')->index(); |
|
18 | + $table->timestamp('created_at'); |
|
19 | + }); |
|
20 | + } |
|
21 | 21 | |
22 | - /** |
|
23 | - * Reverse the migrations. |
|
24 | - * |
|
25 | - * @return void |
|
26 | - */ |
|
27 | - public function down() |
|
28 | - { |
|
29 | - Schema::dropIfExists('password_resets'); |
|
30 | - } |
|
22 | + /** |
|
23 | + * Reverse the migrations. |
|
24 | + * |
|
25 | + * @return void |
|
26 | + */ |
|
27 | + public function down() |
|
28 | + { |
|
29 | + Schema::dropIfExists('password_resets'); |
|
30 | + } |
|
31 | 31 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('password_resets', function (Blueprint $table) { |
|
15 | + Schema::create('password_resets', function(Blueprint $table) { |
|
16 | 16 | $table->string('email')->index(); |
17 | 17 | $table->string('token')->index(); |
18 | 18 | $table->timestamp('created_at'); |
@@ -7,133 +7,133 @@ |
||
7 | 7 | class AclUser extends User |
8 | 8 | { |
9 | 9 | |
10 | - use SoftDeletes, HasApiTokens; |
|
11 | - protected $table = 'users'; |
|
12 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
13 | - protected $hidden = ['password', 'remember_token', 'deleted_at']; |
|
14 | - protected $guarded = ['id']; |
|
15 | - protected $fillable = ['profile_picture', 'name', 'email', 'password', 'locale', 'timezone']; |
|
16 | - public $searchable = ['name', 'email']; |
|
10 | + use SoftDeletes, HasApiTokens; |
|
11 | + protected $table = 'users'; |
|
12 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
13 | + protected $hidden = ['password', 'remember_token', 'deleted_at']; |
|
14 | + protected $guarded = ['id']; |
|
15 | + protected $fillable = ['profile_picture', 'name', 'email', 'password', 'locale', 'timezone']; |
|
16 | + public $searchable = ['name', 'email']; |
|
17 | 17 | |
18 | - public function getCreatedAtAttribute($value) |
|
19 | - { |
|
20 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
21 | - } |
|
22 | - |
|
23 | - public function getUpdatedAtAttribute($value) |
|
24 | - { |
|
25 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
26 | - } |
|
27 | - |
|
28 | - public function getDeletedAtAttribute($value) |
|
29 | - { |
|
30 | - return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
31 | - } |
|
32 | - |
|
33 | - /** |
|
34 | - * Get the profile picture url. |
|
35 | - * @return string |
|
36 | - */ |
|
37 | - public function getProfilePictureAttribute($value) |
|
38 | - { |
|
39 | - return url(\Storage::url($value)); |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * Encrypt the password attribute before |
|
44 | - * saving it in the storage. |
|
45 | - * |
|
46 | - * @param string $value |
|
47 | - */ |
|
48 | - public function setPasswordAttribute($value) |
|
49 | - { |
|
50 | - $this->attributes['password'] = bcrypt($value); |
|
51 | - } |
|
52 | - |
|
53 | - /** |
|
54 | - * Get the entity's notifications. |
|
55 | - */ |
|
56 | - public function notifications() |
|
57 | - { |
|
58 | - return $this->morphMany('App\Modules\Notifications\Notification', 'notifiable')->orderBy('created_at', 'desc'); |
|
59 | - } |
|
60 | - |
|
61 | - /** |
|
62 | - * Get the entity's read notifications. |
|
63 | - */ |
|
64 | - public function readNotifications() |
|
65 | - { |
|
66 | - return $this->notifications()->whereNotNull('read_at'); |
|
67 | - } |
|
68 | - |
|
69 | - /** |
|
70 | - * Get the entity's unread notifications. |
|
71 | - */ |
|
72 | - public function unreadNotifications() |
|
73 | - { |
|
74 | - return $this->notifications()->whereNull('read_at'); |
|
75 | - } |
|
76 | - |
|
77 | - public function groups() |
|
78 | - { |
|
79 | - return $this->belongsToMany('App\Modules\Groups\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
80 | - } |
|
81 | - |
|
82 | - public function oauthClients() |
|
83 | - { |
|
84 | - return $this->hasMany('App\Modules\OauthClients\OauthClient', 'user_id'); |
|
85 | - } |
|
86 | - |
|
87 | - /** |
|
88 | - * Return fcm device tokens that will be used in sending fcm notifications. |
|
89 | - * |
|
90 | - * @return array |
|
91 | - */ |
|
92 | - public function routeNotificationForFCM() |
|
93 | - { |
|
94 | - $devices = \Core::pushNotificationDevices()->findBy(['user_id' => $this->id]); |
|
95 | - $tokens = []; |
|
96 | - |
|
97 | - foreach ($devices as $device) { |
|
98 | - if (\Core::users()->accessTokenExpiredOrRevoked($device->access_token)) { |
|
99 | - $device->forceDelete(); |
|
100 | - continue; |
|
101 | - } |
|
102 | - |
|
103 | - $tokens[] = $device->device_token; |
|
104 | - } |
|
105 | - |
|
106 | - return $tokens; |
|
107 | - } |
|
108 | - |
|
109 | - /** |
|
110 | - * The channels the user receives notification broadcasts on. |
|
111 | - * |
|
112 | - * @return string |
|
113 | - */ |
|
114 | - public function receivesBroadcastNotificationsOn() |
|
115 | - { |
|
116 | - return 'users.'.$this->id; |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * Custom password validation. |
|
121 | - * |
|
122 | - * @param string $password |
|
123 | - * @return boolean |
|
124 | - */ |
|
125 | - public function validateForPassportPasswordGrant($password) |
|
126 | - { |
|
127 | - if ($password == config('skeleton.social_pass')) { |
|
128 | - return true; |
|
129 | - } |
|
130 | - |
|
131 | - return \Hash::check($password, $this->password); |
|
132 | - } |
|
18 | + public function getCreatedAtAttribute($value) |
|
19 | + { |
|
20 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
21 | + } |
|
22 | + |
|
23 | + public function getUpdatedAtAttribute($value) |
|
24 | + { |
|
25 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
26 | + } |
|
27 | + |
|
28 | + public function getDeletedAtAttribute($value) |
|
29 | + { |
|
30 | + return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString(); |
|
31 | + } |
|
32 | + |
|
33 | + /** |
|
34 | + * Get the profile picture url. |
|
35 | + * @return string |
|
36 | + */ |
|
37 | + public function getProfilePictureAttribute($value) |
|
38 | + { |
|
39 | + return url(\Storage::url($value)); |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * Encrypt the password attribute before |
|
44 | + * saving it in the storage. |
|
45 | + * |
|
46 | + * @param string $value |
|
47 | + */ |
|
48 | + public function setPasswordAttribute($value) |
|
49 | + { |
|
50 | + $this->attributes['password'] = bcrypt($value); |
|
51 | + } |
|
52 | + |
|
53 | + /** |
|
54 | + * Get the entity's notifications. |
|
55 | + */ |
|
56 | + public function notifications() |
|
57 | + { |
|
58 | + return $this->morphMany('App\Modules\Notifications\Notification', 'notifiable')->orderBy('created_at', 'desc'); |
|
59 | + } |
|
60 | + |
|
61 | + /** |
|
62 | + * Get the entity's read notifications. |
|
63 | + */ |
|
64 | + public function readNotifications() |
|
65 | + { |
|
66 | + return $this->notifications()->whereNotNull('read_at'); |
|
67 | + } |
|
68 | + |
|
69 | + /** |
|
70 | + * Get the entity's unread notifications. |
|
71 | + */ |
|
72 | + public function unreadNotifications() |
|
73 | + { |
|
74 | + return $this->notifications()->whereNull('read_at'); |
|
75 | + } |
|
76 | + |
|
77 | + public function groups() |
|
78 | + { |
|
79 | + return $this->belongsToMany('App\Modules\Groups\AclGroup', 'users_groups', 'user_id', 'group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
80 | + } |
|
81 | + |
|
82 | + public function oauthClients() |
|
83 | + { |
|
84 | + return $this->hasMany('App\Modules\OauthClients\OauthClient', 'user_id'); |
|
85 | + } |
|
86 | + |
|
87 | + /** |
|
88 | + * Return fcm device tokens that will be used in sending fcm notifications. |
|
89 | + * |
|
90 | + * @return array |
|
91 | + */ |
|
92 | + public function routeNotificationForFCM() |
|
93 | + { |
|
94 | + $devices = \Core::pushNotificationDevices()->findBy(['user_id' => $this->id]); |
|
95 | + $tokens = []; |
|
96 | + |
|
97 | + foreach ($devices as $device) { |
|
98 | + if (\Core::users()->accessTokenExpiredOrRevoked($device->access_token)) { |
|
99 | + $device->forceDelete(); |
|
100 | + continue; |
|
101 | + } |
|
102 | + |
|
103 | + $tokens[] = $device->device_token; |
|
104 | + } |
|
105 | + |
|
106 | + return $tokens; |
|
107 | + } |
|
108 | + |
|
109 | + /** |
|
110 | + * The channels the user receives notification broadcasts on. |
|
111 | + * |
|
112 | + * @return string |
|
113 | + */ |
|
114 | + public function receivesBroadcastNotificationsOn() |
|
115 | + { |
|
116 | + return 'users.'.$this->id; |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * Custom password validation. |
|
121 | + * |
|
122 | + * @param string $password |
|
123 | + * @return boolean |
|
124 | + */ |
|
125 | + public function validateForPassportPasswordGrant($password) |
|
126 | + { |
|
127 | + if ($password == config('skeleton.social_pass')) { |
|
128 | + return true; |
|
129 | + } |
|
130 | + |
|
131 | + return \Hash::check($password, $this->password); |
|
132 | + } |
|
133 | 133 | |
134 | - public static function boot() |
|
135 | - { |
|
136 | - parent::boot(); |
|
137 | - AclUser::observe(\App::make('App\Modules\Users\ModelObservers\AclUserObserver')); |
|
138 | - } |
|
134 | + public static function boot() |
|
135 | + { |
|
136 | + parent::boot(); |
|
137 | + AclUser::observe(\App::make('App\Modules\Users\ModelObservers\AclUserObserver')); |
|
138 | + } |
|
139 | 139 | } |
@@ -9,32 +9,32 @@ |
||
9 | 9 | |
10 | 10 | class AclUser extends JsonResource |
11 | 11 | { |
12 | - /** |
|
13 | - * Transform the resource into an array. |
|
14 | - * |
|
15 | - * @param Request $request |
|
16 | - * @return array |
|
17 | - */ |
|
18 | - public function toArray($request) |
|
19 | - { |
|
20 | - if (! $this->resource) { |
|
21 | - return []; |
|
22 | - } |
|
12 | + /** |
|
13 | + * Transform the resource into an array. |
|
14 | + * |
|
15 | + * @param Request $request |
|
16 | + * @return array |
|
17 | + */ |
|
18 | + public function toArray($request) |
|
19 | + { |
|
20 | + if (! $this->resource) { |
|
21 | + return []; |
|
22 | + } |
|
23 | 23 | |
24 | - return [ |
|
25 | - 'id' => $this->id, |
|
26 | - 'name' => $this->name, |
|
27 | - 'email' => $this->email, |
|
28 | - 'profilePicture' => $this->profile_picture, |
|
29 | - 'notifications' => NotificationResource::collection($this->whenLoaded('notifications')), |
|
30 | - 'readNotifications' => NotificationResource::collection($this->whenLoaded('readNotifications')), |
|
31 | - 'unreadNotifications' => NotificationResource::collection($this->whenLoaded('unreadNotifications')), |
|
32 | - 'groups' => AclGroupResource::collection($this->whenLoaded('groups')), |
|
33 | - 'oauthClients' => OauthClientResource::collection($this->whenLoaded('oauthClients')), |
|
34 | - 'locale' => $this->locale, |
|
35 | - 'timezone' => $this->timezone, |
|
36 | - 'created_at' => $this->created_at, |
|
37 | - 'updated_at' => $this->updated_at, |
|
38 | - ]; |
|
39 | - } |
|
24 | + return [ |
|
25 | + 'id' => $this->id, |
|
26 | + 'name' => $this->name, |
|
27 | + 'email' => $this->email, |
|
28 | + 'profilePicture' => $this->profile_picture, |
|
29 | + 'notifications' => NotificationResource::collection($this->whenLoaded('notifications')), |
|
30 | + 'readNotifications' => NotificationResource::collection($this->whenLoaded('readNotifications')), |
|
31 | + 'unreadNotifications' => NotificationResource::collection($this->whenLoaded('unreadNotifications')), |
|
32 | + 'groups' => AclGroupResource::collection($this->whenLoaded('groups')), |
|
33 | + 'oauthClients' => OauthClientResource::collection($this->whenLoaded('oauthClients')), |
|
34 | + 'locale' => $this->locale, |
|
35 | + 'timezone' => $this->timezone, |
|
36 | + 'created_at' => $this->created_at, |
|
37 | + 'updated_at' => $this->updated_at, |
|
38 | + ]; |
|
39 | + } |
|
40 | 40 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | */ |
18 | 18 | public function toArray($request) |
19 | 19 | { |
20 | - if (! $this->resource) { |
|
20 | + if ( ! $this->resource) { |
|
21 | 21 | return []; |
22 | 22 | } |
23 | 23 |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class SaveProfile 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 | - return [ |
|
27 | - 'profile_picture' => 'nullable|string', |
|
28 | - 'name' => 'nullable|string', |
|
29 | - 'email' => 'required|email|unique:users,email,'.\Auth::id() |
|
30 | - ]; |
|
31 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'profile_picture' => 'nullable|string', |
|
28 | + 'name' => 'nullable|string', |
|
29 | + 'email' => 'required|email|unique:users,email,'.\Auth::id() |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -6,25 +6,25 @@ |
||
6 | 6 | |
7 | 7 | class SendReset 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 | - return [ |
|
27 | - 'email' => 'required|email' |
|
28 | - ]; |
|
29 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'email' => 'required|email' |
|
28 | + ]; |
|
29 | + } |
|
30 | 30 | } |
@@ -6,25 +6,25 @@ |
||
6 | 6 | |
7 | 7 | class RefreshToken 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 | - return [ |
|
27 | - 'refresh_token' => 'required', |
|
28 | - ]; |
|
29 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'refresh_token' => 'required', |
|
28 | + ]; |
|
29 | + } |
|
30 | 30 | } |