@@ -6,27 +6,27 @@ |
||
6 | 6 | |
7 | 7 | class StorePushNotificationDevice 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 | - 'device_token' => $requiredOrNullable . '|string|max:255', |
|
29 | - 'user_id' => $requiredOrNullable . '|exists:users,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 | + $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
27 | + return [ |
|
28 | + 'device_token' => $requiredOrNullable . '|string|max:255', |
|
29 | + 'user_id' => $requiredOrNullable . '|exists:users,id' |
|
30 | + ]; |
|
31 | + } |
|
32 | 32 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | */ |
24 | 24 | public function rules() |
25 | 25 | { |
26 | - $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required' . ''; |
|
26 | + $requiredOrNullable = request()->isMethod('PATCH') ? 'nullable' : 'required'.''; |
|
27 | 27 | return [ |
28 | - 'device_token' => $requiredOrNullable . '|string|max:255', |
|
29 | - 'user_id' => $requiredOrNullable . '|exists:users,id' |
|
28 | + 'device_token' => $requiredOrNullable.'|string|max:255', |
|
29 | + 'user_id' => $requiredOrNullable.'|exists:users,id' |
|
30 | 30 | ]; |
31 | 31 | } |
32 | 32 | } |
@@ -9,23 +9,23 @@ |
||
9 | 9 | class Setting extends Model |
10 | 10 | { |
11 | 11 | |
12 | - use SoftDeletes, Translatable; |
|
13 | - protected $table = 'settings'; |
|
14 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | - protected $hidden = ['deleted_at']; |
|
16 | - protected $guarded = ['id', 'key']; |
|
17 | - public $fillable = ['name', 'value']; |
|
18 | - public $translatable = ['value']; |
|
19 | - public $casts = ['value' => 'json']; |
|
12 | + use SoftDeletes, Translatable; |
|
13 | + protected $table = 'settings'; |
|
14 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
15 | + protected $hidden = ['deleted_at']; |
|
16 | + protected $guarded = ['id', 'key']; |
|
17 | + public $fillable = ['name', 'value']; |
|
18 | + public $translatable = ['value']; |
|
19 | + public $casts = ['value' => 'json']; |
|
20 | 20 | |
21 | - public function newCollection(array $models = []) |
|
22 | - { |
|
23 | - return parent::newCollection($models)->keyBy('key'); |
|
24 | - } |
|
21 | + public function newCollection(array $models = []) |
|
22 | + { |
|
23 | + return parent::newCollection($models)->keyBy('key'); |
|
24 | + } |
|
25 | 25 | |
26 | - public static function boot() |
|
27 | - { |
|
28 | - parent::boot(); |
|
29 | - Setting::observe(SettingsObserver::class); |
|
30 | - } |
|
26 | + public static function boot() |
|
27 | + { |
|
28 | + parent::boot(); |
|
29 | + Setting::observe(SettingsObserver::class); |
|
30 | + } |
|
31 | 31 | } |
@@ -8,103 +8,103 @@ |
||
8 | 8 | |
9 | 9 | class RolesTableSeeder extends Seeder |
10 | 10 | { |
11 | - /** |
|
12 | - * Run the database seeds. |
|
13 | - * |
|
14 | - * @return void |
|
15 | - */ |
|
16 | - public function run() |
|
17 | - { |
|
18 | - /** |
|
19 | - * Create Default roles. |
|
20 | - */ |
|
21 | - Role::updateOrInsert([ |
|
22 | - 'name' => RoleEnum::ADMIN, |
|
23 | - ],[ |
|
24 | - 'created_at' => \DB::raw('NOW()'), |
|
25 | - 'updated_at' => \DB::raw('NOW()') |
|
26 | - ]); |
|
11 | + /** |
|
12 | + * Run the database seeds. |
|
13 | + * |
|
14 | + * @return void |
|
15 | + */ |
|
16 | + public function run() |
|
17 | + { |
|
18 | + /** |
|
19 | + * Create Default roles. |
|
20 | + */ |
|
21 | + Role::updateOrInsert([ |
|
22 | + 'name' => RoleEnum::ADMIN, |
|
23 | + ],[ |
|
24 | + 'created_at' => \DB::raw('NOW()'), |
|
25 | + 'updated_at' => \DB::raw('NOW()') |
|
26 | + ]); |
|
27 | 27 | |
28 | - /** |
|
29 | - * Create Default user. |
|
30 | - */ |
|
31 | - AclUser::firstOrCreate([ |
|
32 | - 'email' => '[email protected]', |
|
33 | - ],[ |
|
34 | - 'name' => 'Admin', |
|
35 | - 'password' => \Hash::make('123456'), |
|
36 | - 'confirmed' => 1, |
|
37 | - 'created_at' => \DB::raw('NOW()'), |
|
38 | - 'updated_at' => \DB::raw('NOW()') |
|
39 | - ]); |
|
28 | + /** |
|
29 | + * Create Default user. |
|
30 | + */ |
|
31 | + AclUser::firstOrCreate([ |
|
32 | + 'email' => '[email protected]', |
|
33 | + ],[ |
|
34 | + 'name' => 'Admin', |
|
35 | + 'password' => \Hash::make('123456'), |
|
36 | + 'confirmed' => 1, |
|
37 | + 'created_at' => \DB::raw('NOW()'), |
|
38 | + 'updated_at' => \DB::raw('NOW()') |
|
39 | + ]); |
|
40 | 40 | |
41 | - /** |
|
42 | - * Assign default users to admin roles. |
|
43 | - */ |
|
44 | - $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id;; |
|
45 | - $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id; |
|
46 | - \DB::table('role_user')->updateOrInsert([ |
|
47 | - 'user_id' => $adminUserId, |
|
48 | - 'role_id' => $adminRoleId, |
|
49 | - ],[]); |
|
41 | + /** |
|
42 | + * Assign default users to admin roles. |
|
43 | + */ |
|
44 | + $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id;; |
|
45 | + $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id; |
|
46 | + \DB::table('role_user')->updateOrInsert([ |
|
47 | + 'user_id' => $adminUserId, |
|
48 | + 'role_id' => $adminRoleId, |
|
49 | + ],[]); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Insert the permissions related to roles table. |
|
53 | - */ |
|
54 | - \DB::table('permissions')->insert( |
|
55 | - [ |
|
56 | - /** |
|
57 | - * Roles model permissions. |
|
58 | - */ |
|
59 | - [ |
|
60 | - 'name' => 'index', |
|
61 | - 'model' => 'role', |
|
62 | - 'created_at' => \DB::raw('NOW()'), |
|
63 | - 'updated_at' => \DB::raw('NOW()') |
|
64 | - ], |
|
65 | - [ |
|
66 | - 'name' => 'show', |
|
67 | - 'model' => 'role', |
|
68 | - 'created_at' => \DB::raw('NOW()'), |
|
69 | - 'updated_at' => \DB::raw('NOW()') |
|
70 | - ], |
|
71 | - [ |
|
72 | - 'name' => 'store', |
|
73 | - 'model' => 'role', |
|
74 | - 'created_at' => \DB::raw('NOW()'), |
|
75 | - 'updated_at' => \DB::raw('NOW()') |
|
76 | - ], |
|
77 | - [ |
|
78 | - 'name' => 'update', |
|
79 | - 'model' => 'role', |
|
80 | - 'created_at' => \DB::raw('NOW()'), |
|
81 | - 'updated_at' => \DB::raw('NOW()') |
|
82 | - ], |
|
83 | - [ |
|
84 | - 'name' => 'destroy', |
|
85 | - 'model' => 'role', |
|
86 | - 'created_at' => \DB::raw('NOW()'), |
|
87 | - 'updated_at' => \DB::raw('NOW()') |
|
88 | - ], |
|
89 | - [ |
|
90 | - 'name' => 'deleted', |
|
91 | - 'model' => 'role', |
|
92 | - 'created_at' => \DB::raw('NOW()'), |
|
93 | - 'updated_at' => \DB::raw('NOW()') |
|
94 | - ], |
|
95 | - [ |
|
96 | - 'name' => 'restore', |
|
97 | - 'model' => 'role', |
|
98 | - 'created_at' => \DB::raw('NOW()'), |
|
99 | - 'updated_at' => \DB::raw('NOW()') |
|
100 | - ], |
|
101 | - [ |
|
102 | - 'name' => 'assignPermissions', |
|
103 | - 'model' => 'role', |
|
104 | - 'created_at' => \DB::raw('NOW()'), |
|
105 | - 'updated_at' => \DB::raw('NOW()') |
|
106 | - ], |
|
107 | - ] |
|
108 | - ); |
|
109 | - } |
|
51 | + /** |
|
52 | + * Insert the permissions related to roles table. |
|
53 | + */ |
|
54 | + \DB::table('permissions')->insert( |
|
55 | + [ |
|
56 | + /** |
|
57 | + * Roles model permissions. |
|
58 | + */ |
|
59 | + [ |
|
60 | + 'name' => 'index', |
|
61 | + 'model' => 'role', |
|
62 | + 'created_at' => \DB::raw('NOW()'), |
|
63 | + 'updated_at' => \DB::raw('NOW()') |
|
64 | + ], |
|
65 | + [ |
|
66 | + 'name' => 'show', |
|
67 | + 'model' => 'role', |
|
68 | + 'created_at' => \DB::raw('NOW()'), |
|
69 | + 'updated_at' => \DB::raw('NOW()') |
|
70 | + ], |
|
71 | + [ |
|
72 | + 'name' => 'store', |
|
73 | + 'model' => 'role', |
|
74 | + 'created_at' => \DB::raw('NOW()'), |
|
75 | + 'updated_at' => \DB::raw('NOW()') |
|
76 | + ], |
|
77 | + [ |
|
78 | + 'name' => 'update', |
|
79 | + 'model' => 'role', |
|
80 | + 'created_at' => \DB::raw('NOW()'), |
|
81 | + 'updated_at' => \DB::raw('NOW()') |
|
82 | + ], |
|
83 | + [ |
|
84 | + 'name' => 'destroy', |
|
85 | + 'model' => 'role', |
|
86 | + 'created_at' => \DB::raw('NOW()'), |
|
87 | + 'updated_at' => \DB::raw('NOW()') |
|
88 | + ], |
|
89 | + [ |
|
90 | + 'name' => 'deleted', |
|
91 | + 'model' => 'role', |
|
92 | + 'created_at' => \DB::raw('NOW()'), |
|
93 | + 'updated_at' => \DB::raw('NOW()') |
|
94 | + ], |
|
95 | + [ |
|
96 | + 'name' => 'restore', |
|
97 | + 'model' => 'role', |
|
98 | + 'created_at' => \DB::raw('NOW()'), |
|
99 | + 'updated_at' => \DB::raw('NOW()') |
|
100 | + ], |
|
101 | + [ |
|
102 | + 'name' => 'assignPermissions', |
|
103 | + 'model' => 'role', |
|
104 | + 'created_at' => \DB::raw('NOW()'), |
|
105 | + 'updated_at' => \DB::raw('NOW()') |
|
106 | + ], |
|
107 | + ] |
|
108 | + ); |
|
109 | + } |
|
110 | 110 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | Role::updateOrInsert([ |
22 | 22 | 'name' => RoleEnum::ADMIN, |
23 | - ],[ |
|
23 | + ], [ |
|
24 | 24 | 'created_at' => \DB::raw('NOW()'), |
25 | 25 | 'updated_at' => \DB::raw('NOW()') |
26 | 26 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | AclUser::firstOrCreate([ |
32 | 32 | 'email' => '[email protected]', |
33 | - ],[ |
|
33 | + ], [ |
|
34 | 34 | 'name' => 'Admin', |
35 | 35 | 'password' => \Hash::make('123456'), |
36 | 36 | 'confirmed' => 1, |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * Assign default users to admin roles. |
43 | 43 | */ |
44 | - $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id;; |
|
44 | + $adminRoleId = Role::where('name', RoleEnum::ADMIN)->select('id')->first()->id; ; |
|
45 | 45 | $adminUserId = AclUser::where('email', '[email protected]')->select('id')->first()->id; |
46 | 46 | \DB::table('role_user')->updateOrInsert([ |
47 | 47 | 'user_id' => $adminUserId, |
48 | 48 | 'role_id' => $adminRoleId, |
49 | - ],[]); |
|
49 | + ], []); |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Insert the permissions related to roles table. |