@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | protected static function bootEvent() |
21 | 21 | { |
22 | - static::deleting(function (User $model) { |
|
22 | + static::deleting(function(User $model) { |
|
23 | 23 | $model->roles->map->delete(); |
24 | 24 | }); |
25 | 25 | } |
@@ -20,8 +20,8 @@ |
||
20 | 20 | */ |
21 | 21 | protected static function bootEvent() |
22 | 22 | { |
23 | - static::deleting(function (Customer $model) { |
|
24 | - Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH . '/' . $model->getRawOriginal('identitycard_image')); |
|
23 | + static::deleting(function(Customer $model) { |
|
24 | + Storage::delete(Customer::IDENTITYCARD_IMAGE_PATH.'/'.$model->getRawOriginal('identitycard_image')); |
|
25 | 25 | }); |
26 | 26 | } |
27 | 27 | } |
@@ -26,21 +26,21 @@ |
||
26 | 26 | public function rules() |
27 | 27 | { |
28 | 28 | return [ |
29 | - 'branch_id' => 'required|exists:' . Branch::class . ',id', |
|
30 | - 'username' => 'required|string|max:255|unique:' . User::class, |
|
29 | + 'branch_id' => 'required|exists:'.Branch::class.',id', |
|
30 | + 'username' => 'required|string|max:255|unique:'.User::class, |
|
31 | 31 | 'fullname' => 'required|string|max:255', |
32 | - 'gender' => 'sometimes|nullable|enum:' . Gender::class, |
|
33 | - 'email' => 'required|string|email|max:255|unique:' . User::class, |
|
32 | + 'gender' => 'sometimes|nullable|enum:'.Gender::class, |
|
33 | + 'email' => 'required|string|email|max:255|unique:'.User::class, |
|
34 | 34 | 'phone_country' => 'sometimes|in:ID', |
35 | - 'phone' => ['required', 'string', 'phone:ID', function ($attribute, $phone, $fail) { |
|
35 | + 'phone' => [ 'required', 'string', 'phone:ID', function($attribute, $phone, $fail) { |
|
36 | 36 | $user = User::where($attribute, PhoneNumber::make($phone, request()->input('phone_country', env('PHONE_COUNTRY', 'ID')))->formatE164())->count(); |
37 | 37 | |
38 | 38 | if ($user > 0) { |
39 | - $fail(trans('validation.unique', ['attribute' => static::getAttributes()[$attribute]])); |
|
39 | + $fail(trans('validation.unique', [ 'attribute' => static::getAttributes()[ $attribute ] ])); |
|
40 | 40 | } |
41 | - }], |
|
42 | - 'password' => ['required', 'confirmed', Rules\Password::defaults()], |
|
43 | - 'role' => 'required|exists:' . Role::class . ',name', |
|
41 | + } ], |
|
42 | + 'password' => [ 'required', 'confirmed', Rules\Password::defaults() ], |
|
43 | + 'role' => 'required|exists:'.Role::class.',name', |
|
44 | 44 | 'is_active' => 'required|boolean', |
45 | 45 | ]; |
46 | 46 | } |
@@ -27,23 +27,23 @@ |
||
27 | 27 | public function rules() |
28 | 28 | { |
29 | 29 | return [ |
30 | - 'branch_id' => 'required|exists:' . Branch::class . ',id', |
|
31 | - 'username' => ['required', 'string', 'max:255', Rule::unique(User::class)->ignoreModel($this->route('user'))], |
|
30 | + 'branch_id' => 'required|exists:'.Branch::class.',id', |
|
31 | + 'username' => [ 'required', 'string', 'max:255', Rule::unique(User::class)->ignoreModel($this->route('user')) ], |
|
32 | 32 | 'fullname' => 'required|string|max:255', |
33 | - 'gender' => 'sometimes|nullable|enum:' . Gender::class, |
|
34 | - 'email' => ['required', 'string', 'email', 'max:255', Rule::unique(User::class)->ignoreModel($this->route('user'))], |
|
33 | + 'gender' => 'sometimes|nullable|enum:'.Gender::class, |
|
34 | + 'email' => [ 'required', 'string', 'email', 'max:255', Rule::unique(User::class)->ignoreModel($this->route('user')) ], |
|
35 | 35 | 'phone_country' => 'sometimes|in:ID', |
36 | - 'phone' => ['required', 'string', 'phone:ID', function ($attribute, $phone, $fail) { |
|
36 | + 'phone' => [ 'required', 'string', 'phone:ID', function($attribute, $phone, $fail) { |
|
37 | 37 | $user = User::where($attribute, PhoneNumber::make($phone, request()->input('phone_country', env('PHONE_COUNTRY', 'ID')))->formatE164()) |
38 | 38 | ->where($this->route('user')->getKeyName(), '!=', $this->route('user')->getKey()) |
39 | 39 | ->count(); |
40 | 40 | |
41 | 41 | if ($user > 0) { |
42 | - $fail(trans('validation.unique', ['attribute' => static::getAttributes()[$attribute]])); |
|
42 | + $fail(trans('validation.unique', [ 'attribute' => static::getAttributes()[ $attribute ] ])); |
|
43 | 43 | } |
44 | - }], |
|
45 | - 'password' => ['sometimes', 'nullable', 'confirmed', Rules\Password::defaults()], |
|
46 | - 'role' => 'required|exists:' . Role::class . ',name', |
|
44 | + } ], |
|
45 | + 'password' => [ 'sometimes', 'nullable', 'confirmed', Rules\Password::defaults() ], |
|
46 | + 'role' => 'required|exists:'.Role::class.',name', |
|
47 | 47 | 'is_active' => 'required|boolean', |
48 | 48 | ]; |
49 | 49 | } |
@@ -18,20 +18,20 @@ |
||
18 | 18 | public static function getRules() |
19 | 19 | { |
20 | 20 | return [ |
21 | - 'branch_name' => 'required|exists:' . Branch::class . ',name', |
|
22 | - 'username' => 'required|string|max:255|unique:' . User::class, |
|
21 | + 'branch_name' => 'required|exists:'.Branch::class.',name', |
|
22 | + 'username' => 'required|string|max:255|unique:'.User::class, |
|
23 | 23 | 'fullname' => 'required|string|max:255', |
24 | - 'gender' => 'sometimes|nullable|enum:' . Gender::class, |
|
25 | - 'email' => 'required|string|email|max:255|unique:' . User::class, |
|
24 | + 'gender' => 'sometimes|nullable|enum:'.Gender::class, |
|
25 | + 'email' => 'required|string|email|max:255|unique:'.User::class, |
|
26 | 26 | 'phone_country' => 'sometimes|in:ID', |
27 | - 'phone' => ['required', 'string', 'phone:ID', function ($attribute, $phone, $fail) { |
|
27 | + 'phone' => [ 'required', 'string', 'phone:ID', function($attribute, $phone, $fail) { |
|
28 | 28 | $user = User::where('phone', PhoneNumber::make($phone, request()->input('phone_country', env('PHONE_COUNTRY', 'ID')))->formatE164())->count(); |
29 | 29 | |
30 | 30 | if ($user > 0) { |
31 | - $fail(trans('validation.unique', ['attribute' => static::getAttributes()[$attribute]])); |
|
31 | + $fail(trans('validation.unique', [ 'attribute' => static::getAttributes()[ $attribute ] ])); |
|
32 | 32 | } |
33 | - }], |
|
34 | - 'password' => ['required', 'confirmed', Rules\Password::defaults()], |
|
33 | + } ], |
|
34 | + 'password' => [ 'required', 'confirmed', Rules\Password::defaults() ], |
|
35 | 35 | 'agree_with_terms' => 'required|boolean|in:1', |
36 | 36 | ]; |
37 | 37 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | public function rules() |
22 | 22 | { |
23 | 23 | return [ |
24 | - 'name' => 'required|string|max:255|unique:' . Branch::class, |
|
24 | + 'name' => 'required|string|max:255|unique:'.Branch::class, |
|
25 | 25 | 'address' => 'required|string', |
26 | 26 | 'address_latitude' => 'required|numeric', |
27 | 27 | 'address_longitude' => 'required|numeric', |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'whatsapp_phone' => $this->faker->numerify('081#########'), |
40 | 40 | 'account_number' => $this->faker->numerify('#########'), |
41 | 41 | 'identitycard_number' => $this->faker->numerify('################'), |
42 | - 'identitycard_image' => UploadedFile::fake()->image(Str::random() . '.jpg'), |
|
42 | + 'identitycard_image' => UploadedFile::fake()->image(Str::random().'.jpg'), |
|
43 | 43 | 'location_latitude' => $this->faker->latitude, |
44 | 44 | 'location_longitude' => $this->faker->longitude, |
45 | 45 | ]; |
@@ -13,8 +13,8 @@ |
||
13 | 13 | public function rules() |
14 | 14 | { |
15 | 15 | return [ |
16 | - 'name' => 'required|string|max:255|unique:' . Role::class, |
|
17 | - 'guard_name' => ['required', 'string', Rule::in(array_keys(config('auth.guards')))], |
|
16 | + 'name' => 'required|string|max:255|unique:'.Role::class, |
|
17 | + 'guard_name' => [ 'required', 'string', Rule::in(array_keys(config('auth.guards'))) ], |
|
18 | 18 | ]; |
19 | 19 | } |
20 | 20 | } |
@@ -13,8 +13,8 @@ |
||
13 | 13 | public function rules() |
14 | 14 | { |
15 | 15 | return [ |
16 | - 'name' => ['required', 'string', 'max:255', Rule::unique(Role::class)->ignoreModel($this->route('role'))], |
|
17 | - 'guard_name' => ['required', 'string', Rule::in(array_keys(config('auth.guards')))], |
|
16 | + 'name' => [ 'required', 'string', 'max:255', Rule::unique(Role::class)->ignoreModel($this->route('role')) ], |
|
17 | + 'guard_name' => [ 'required', 'string', Rule::in(array_keys(config('auth.guards'))) ], |
|
18 | 18 | ]; |
19 | 19 | } |
20 | 20 | } |