@@ -3,12 +3,12 @@ |
||
| 3 | 3 | use FaithGen\SDK\Http\Controllers\MinistryController; |
| 4 | 4 | use Illuminate\Support\Facades\Route; |
| 5 | 5 | |
| 6 | -Route::name('ministry.')->prefix('ministry/')->group(function () { |
|
| 7 | - Route::get('users', [MinistryController::class, 'users']); |
|
| 8 | - Route::put('social-link', [MinistryController::class, 'saveSocialLink']); |
|
| 9 | - Route::post('profile', [MinistryController::class, 'updateProfile']); |
|
| 10 | - Route::post('photo', [MinistryController::class, 'updatePhoto']); |
|
| 11 | - Route::post('password', [MinistryController::class, 'updatePassword']); |
|
| 12 | - Route::post('users/toggle-activity', [MinistryController::class, 'toggleActivity']); |
|
| 13 | - Route::delete('/', [MinistryController::class, 'deleteProfile']); |
|
| 6 | +Route::name('ministry.')->prefix('ministry/')->group(function() { |
|
| 7 | + Route::get('users', [ MinistryController::class, 'users' ]); |
|
| 8 | + Route::put('social-link', [ MinistryController::class, 'saveSocialLink' ]); |
|
| 9 | + Route::post('profile', [ MinistryController::class, 'updateProfile' ]); |
|
| 10 | + Route::post('photo', [ MinistryController::class, 'updatePhoto' ]); |
|
| 11 | + Route::post('password', [ MinistryController::class, 'updatePassword' ]); |
|
| 12 | + Route::post('users/toggle-activity', [ MinistryController::class, 'toggleActivity' ]); |
|
| 13 | + Route::delete('/', [ MinistryController::class, 'deleteProfile' ]); |
|
| 14 | 14 | }); |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | { |
| 10 | 10 | public function creating(Activation $activation) |
| 11 | 11 | { |
| 12 | - $activation->code = (string) Str::uuid(); |
|
| 12 | + $activation->code = (string)Str::uuid(); |
|
| 13 | 13 | } |
| 14 | 14 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function creating(Ministry $ministry) |
| 16 | 16 | { |
| 17 | 17 | $ministry->password = Hash::make(request()->password); |
| 18 | - $ministry->id = (string) Str::uuid(); |
|
| 18 | + $ministry->id = (string)Str::uuid(); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | public function creating(User $user) |
| 24 | 24 | { |
| 25 | - $user->id = (string) Str::uuid(); |
|
| 25 | + $user->id = (string)Str::uuid(); |
|
| 26 | 26 | $user->password = Hash::make(env('DEFAULT_PASSWORD', 'secret')); |
| 27 | 27 | } |
| 28 | 28 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $ministryUser = auth()->user() |
| 66 | 66 | ->ministryUsers() |
| 67 | - ->whereHas('user', fn ($user) => $user->where($request->validated())) |
|
| 67 | + ->whereHas('user', fn($user) => $user->where($request->validated())) |
|
| 68 | 68 | ->first(); |
| 69 | 69 | |
| 70 | 70 | if ($ministryUser) { |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | 'processing_image' => $request->has('image'), |
| 90 | 90 | ]; |
| 91 | 91 | |
| 92 | - if (! $request->has('image')) { |
|
| 92 | + if (!$request->has('image')) { |
|
| 93 | 93 | return $this->successResponse($messagePrefix, $data); |
| 94 | 94 | } else { |
| 95 | - return $this->successResponse($messagePrefix.' We are uploading your picture now', $data); |
|
| 95 | + return $this->successResponse($messagePrefix . ' We are uploading your picture now', $data); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function presenceRegister(PresenceRegistryRequest $request) |
| 18 | 18 | { |
| 19 | - if (! config('faithgen-sdk.source')) { |
|
| 19 | + if (!config('faithgen-sdk.source')) { |
|
| 20 | 20 | event(new UserPresent(auth('web')->user(), $request->validated())); |
| 21 | 21 | } |
| 22 | 22 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | public function showTyping(PresenceRegistryRequest $request) |
| 30 | 30 | { |
| 31 | - if (! config('faithgen-sdk.source')) { |
|
| 31 | + if (!config('faithgen-sdk.source')) { |
|
| 32 | 32 | event(new TypingRegistered(auth('web')->user(), $request->validated())); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | return [ |
| 28 | 28 | 'review' => 'required|string', |
| 29 | - 'type' => 'required|in:'.implode(',', Helper::$reviewTypes), |
|
| 29 | + 'type' => 'required|in:' . implode(',', Helper::$reviewTypes), |
|
| 30 | 30 | ]; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | 'email' => 'required|email', |
| 30 | 30 | 'phone' => 'required', //todo write a regex to serve, |
| 31 | 31 | 'links' => 'array', |
| 32 | - 'color' => 'required|'.Helper::$hexColorRegex, |
|
| 32 | + 'color' => 'required|' . Helper::$hexColorRegex, |
|
| 33 | 33 | 'location' => 'array', |
| 34 | 34 | 'links.*' => 'url', |
| 35 | 35 | 'statement' => 'array', |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | 'phones' => 'array', |
| 39 | 39 | 'emails.*' => 'email', |
| 40 | 40 | 'services' => 'array', |
| 41 | - 'services.*.day' => 'required|in:'.implode(',', Helper::$weekDays), |
|
| 42 | - 'services.*.start' => ['required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/'], |
|
| 43 | - 'services.*.finish' => ['required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/'], |
|
| 41 | + 'services.*.day' => 'required|in:' . implode(',', Helper::$weekDays), |
|
| 42 | + 'services.*.start' => [ 'required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/' ], |
|
| 43 | + 'services.*.finish' => [ 'required', 'date_format:H:i', 'regex:/^((([01]?[0-9]|2[0-3]):[0-5][0-9])?)$/' ], |
|
| 44 | 44 | 'services.*.alias' => 'nullable', |
| 45 | 45 | ]; |
| 46 | 46 | } |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function search() |
| 15 | 15 | { |
| 16 | - return function ($attributes, ?string $filter_text) { |
|
| 16 | + return function($attributes, ?string $filter_text) { |
|
| 17 | 17 | if ($filter_text) { |
| 18 | - $filter_text = '%'.$filter_text.'%'; |
|
| 18 | + $filter_text = '%' . $filter_text . '%'; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | if (is_string($attributes)) { |
@@ -27,16 +27,16 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $attribute = $attributes->first(); |
| 29 | 29 | |
| 30 | - $remainderKeys = $attributes->filter(fn ($field) => $field !== $attribute)->toArray(); |
|
| 30 | + $remainderKeys = $attributes->filter(fn($field) => $field !== $attribute)->toArray(); |
|
| 31 | 31 | |
| 32 | 32 | $query = $this->where($attribute, 'LIKE', $filter_text); |
| 33 | 33 | |
| 34 | 34 | if (count($remainderKeys)) { |
| 35 | 35 | foreach ($remainderKeys as $key) { |
| 36 | - if (! Str::of($key)->contains('.')) { |
|
| 36 | + if (!Str::of($key)->contains('.')) { |
|
| 37 | 37 | $query->orWhere($key, 'LIKE', $filter_text); |
| 38 | 38 | } else { |
| 39 | - [$relationship, $column] = explode('.', $key); |
|
| 39 | + [ $relationship, $column ] = explode('.', $key); |
|
| 40 | 40 | |
| 41 | 41 | // $eloquentBuilder->orWhereHas($relationship, fn($model) => $model->where($column, 'LIKE', $filter_text)); |
| 42 | 42 | } |