@@ -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,37 +5,37 @@ |
||
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 | - }); |
|
30 | - } |
|
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 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * Reverse the migrations. |
|
34 | - * |
|
35 | - * @return void |
|
36 | - */ |
|
37 | - public function down() |
|
38 | - { |
|
39 | - Schema::dropIfExists('users'); |
|
40 | - } |
|
32 | + /** |
|
33 | + * Reverse the migrations. |
|
34 | + * |
|
35 | + * @return void |
|
36 | + */ |
|
37 | + public function down() |
|
38 | + { |
|
39 | + Schema::dropIfExists('users'); |
|
40 | + } |
|
41 | 41 | } |
@@ -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'); |
@@ -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 |
@@ -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 ? url(\Storage::url($this->profile_picture)) : null, |
|
29 | - 'notifications' => NotificationResource::collection($this->whenLoaded('notifications')), |
|
30 | - 'readNotifications' => NotificationResource::collection($this->whenLoaded('readNotifications')), |
|
31 | - 'unreadNotifications' => NotificationResource::collection($this->whenLoaded('unreadNotifications')), |
|
32 | - 'roles' => RoleResource::collection($this->whenLoaded('roles')), |
|
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 ? url(\Storage::url($this->profile_picture)) : null, |
|
29 | + 'notifications' => NotificationResource::collection($this->whenLoaded('notifications')), |
|
30 | + 'readNotifications' => NotificationResource::collection($this->whenLoaded('readNotifications')), |
|
31 | + 'unreadNotifications' => NotificationResource::collection($this->whenLoaded('unreadNotifications')), |
|
32 | + 'roles' => RoleResource::collection($this->whenLoaded('roles')), |
|
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 | } |
@@ -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 | } |
@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class ChangePassword 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 | - 'old_password' => 'required', |
|
28 | - 'password' => 'required|confirmed|min:6', |
|
29 | - 'password_confirmation' => 'required' |
|
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 | + 'old_password' => 'required', |
|
28 | + 'password' => 'required|confirmed|min:6', |
|
29 | + 'password_confirmation' => 'required' |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -6,25 +6,25 @@ |
||
6 | 6 | |
7 | 7 | class ResendEmailConfirmation 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|exists:users,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|exists:users,email' |
|
28 | + ]; |
|
29 | + } |
|
30 | 30 | } |
@@ -6,28 +6,28 @@ |
||
6 | 6 | |
7 | 7 | class ResetPassword 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 | - 'token' => 'required', |
|
28 | - 'email' => 'required|email', |
|
29 | - 'password' => 'required|confirmed|min:6', |
|
30 | - 'password_confirmation' => 'required', |
|
31 | - ]; |
|
32 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'token' => 'required', |
|
28 | + 'email' => 'required|email', |
|
29 | + 'password' => 'required|confirmed|min:6', |
|
30 | + 'password_confirmation' => 'required', |
|
31 | + ]; |
|
32 | + } |
|
33 | 33 | } |