@@ -39,6 +39,6 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function getUnsetFields(): array |
| 41 | 41 | { |
| 42 | - return ['image_id']; |
|
| 42 | + return [ 'image_id' ]; |
|
| 43 | 43 | } |
| 44 | 44 | } |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function getUnsetFields(): array |
| 35 | 35 | { |
| 36 | - return ['name', 'email', 'phone']; |
|
| 36 | + return [ 'name', 'email', 'phone' ]; |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -6,26 +6,26 @@ |
||
| 6 | 6 | use FaithGen\SDK\Http\Controllers\ReviewController; |
| 7 | 7 | use Illuminate\Support\Facades\Route; |
| 8 | 8 | |
| 9 | -Route::name('ministry.')->prefix('ministry/')->group(function () { |
|
| 10 | - Route::post('social-link', [MinistryController::class, 'getSocialLink']); |
|
| 11 | - Route::get('profile', [MinistryController::class, 'getProfile']); |
|
| 12 | - Route::get('account-type', [MinistryController::class, 'accountType']); |
|
| 9 | +Route::name('ministry.')->prefix('ministry/')->group(function() { |
|
| 10 | + Route::post('social-link', [ MinistryController::class, 'getSocialLink' ]); |
|
| 11 | + Route::get('profile', [ MinistryController::class, 'getProfile' ]); |
|
| 12 | + Route::get('account-type', [ MinistryController::class, 'accountType' ]); |
|
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | -Route::name('images.')->prefix('images')->group(function () { |
|
| 16 | - Route::post('comment/{image}', [ImageController::class, 'comment']); |
|
| 17 | - Route::get('comments/{image}', [ImageController::class, 'comments']); |
|
| 15 | +Route::name('images.')->prefix('images')->group(function() { |
|
| 16 | + Route::post('comment/{image}', [ ImageController::class, 'comment' ]); |
|
| 17 | + Route::get('comments/{image}', [ ImageController::class, 'comments' ]); |
|
| 18 | 18 | }); |
| 19 | 19 | |
| 20 | 20 | Route::prefix('reviews') |
| 21 | - ->group(function () { |
|
| 22 | - Route::post('', [ReviewController::class, 'sendReview']); |
|
| 21 | + ->group(function() { |
|
| 22 | + Route::post('', [ ReviewController::class, 'sendReview' ]); |
|
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | -if (! config('faithgen-sdk.source')) { |
|
| 25 | +if (!config('faithgen-sdk.source')) { |
|
| 26 | 26 | Route::prefix('comments') |
| 27 | - ->group(function () { |
|
| 28 | - Route::post('presence', [CommentController::class, 'presenceRegister']); |
|
| 29 | - Route::post('typing', [CommentController::class, 'showTyping']); |
|
| 27 | + ->group(function() { |
|
| 28 | + Route::post('presence', [ CommentController::class, 'presenceRegister' ]); |
|
| 29 | + Route::post('typing', [ CommentController::class, 'showTyping' ]); |
|
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -21,13 +21,13 @@ |
||
| 21 | 21 | $modelName = $routeModel->keys()->first(); |
| 22 | 22 | |
| 23 | 23 | $binding = collect(app()->getBindings()) |
| 24 | - ->filter(function ($binding, $key) use ($modelName) { |
|
| 25 | - return Str::contains($key, '\\'.ucfirst($modelName)) && Str::endsWith($key, 'Service'); |
|
| 24 | + ->filter(function($binding, $key) use ($modelName) { |
|
| 25 | + return Str::contains($key, '\\' . ucfirst($modelName)) && Str::endsWith($key, 'Service'); |
|
| 26 | 26 | }) |
| 27 | 27 | ->keys() |
| 28 | 28 | ->first(); |
| 29 | 29 | |
| 30 | - $modelMethod = 'get'.ucwords($modelName); |
|
| 30 | + $modelMethod = 'get' . ucwords($modelName); |
|
| 31 | 31 | |
| 32 | 32 | return $this->user()->can('view', app($binding)->$modelMethod()); |
| 33 | 33 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function up() |
| 16 | 16 | { |
| 17 | - Schema::create('fg_accounts', function (Blueprint $table) { |
|
| 17 | + Schema::create('fg_accounts', function(Blueprint $table) { |
|
| 18 | 18 | $table->string('id', 150)->primary(); |
| 19 | 19 | $table->string('ministry_id', 150)->index(); |
| 20 | 20 | $table->enum('level', Ministry::ACCOUNT_LEVELS)->default('Free'); |
@@ -23,32 +23,32 @@ discard block |
||
| 23 | 23 | $this->registerUserAuthRoutes(); |
| 24 | 24 | |
| 25 | 25 | if ($this->app->runningInConsole()) { |
| 26 | - $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); |
|
| 26 | + $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); |
|
| 27 | 27 | |
| 28 | 28 | $this->publishes([ |
| 29 | - __DIR__.'/../config/faithgen-sdk.php' => config_path('faithgen-sdk.php'), |
|
| 29 | + __DIR__ . '/../config/faithgen-sdk.php' => config_path('faithgen-sdk.php'), |
|
| 30 | 30 | ], 'faithgen-sdk-config'); |
| 31 | 31 | |
| 32 | - $this->setUpSourceFiles(function () { |
|
| 32 | + $this->setUpSourceFiles(function() { |
|
| 33 | 33 | $this->publishes([ |
| 34 | - __DIR__.'/../database/migrations/' => database_path('migrations'), |
|
| 34 | + __DIR__ . '/../database/migrations/' => database_path('migrations'), |
|
| 35 | 35 | ], 'faithgen-sdk-migrations'); |
| 36 | 36 | |
| 37 | 37 | $this->publishes([ |
| 38 | - __DIR__.'/../storage/profile/' => storage_path('app/public/profile'), |
|
| 38 | + __DIR__ . '/../storage/profile/' => storage_path('app/public/profile'), |
|
| 39 | 39 | ], 'faithgen-sdk-storage'); |
| 40 | 40 | |
| 41 | - $this->loadFactoriesFrom(__DIR__.'/../database/factories'); |
|
| 41 | + $this->loadFactoriesFrom(__DIR__ . '/../database/factories'); |
|
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | - if (! config('faithgen-sdk.source')) { |
|
| 44 | + if (!config('faithgen-sdk.source')) { |
|
| 45 | 45 | $this->publishes([ |
| 46 | - __DIR__.'/../storage/users/' => storage_path('app/public/users'), |
|
| 46 | + __DIR__ . '/../storage/users/' => storage_path('app/public/users'), |
|
| 47 | 47 | ], 'faithgen-sdk-storage'); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | $this->publishes([ |
| 51 | - __DIR__.'/../storage/logo/' => public_path('images'), |
|
| 51 | + __DIR__ . '/../storage/logo/' => public_path('images'), |
|
| 52 | 52 | ], 'faithgen-logo'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | private function registerApiRoutes() |
| 74 | 74 | { |
| 75 | - Route::group($this->apiRouteConfiguration(), function () { |
|
| 76 | - $this->loadRoutesFrom(__DIR__.'/../routes/api.php'); |
|
| 75 | + Route::group($this->apiRouteConfiguration(), function() { |
|
| 76 | + $this->loadRoutesFrom(__DIR__ . '/../routes/api.php'); |
|
| 77 | 77 | }); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | private function registerParentRoutes() |
| 94 | 94 | { |
| 95 | 95 | if (config('faithgen-sdk.source')) { |
| 96 | - Route::group($this->parentRouteConfiguration(), function () { |
|
| 97 | - $this->loadRoutesFrom(__DIR__.'/../routes/source.php'); |
|
| 96 | + Route::group($this->parentRouteConfiguration(), function() { |
|
| 97 | + $this->loadRoutesFrom(__DIR__ . '/../routes/source.php'); |
|
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | 100 | $this->registerAuthRoutes(); |
| 101 | 101 | |
| 102 | - $this->loadRoutesFrom(__DIR__.'/../routes/web.php'); |
|
| 102 | + $this->loadRoutesFrom(__DIR__ . '/../routes/web.php'); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | return [ |
| 109 | 109 | 'prefix' => config('faithgen-sdk.prefix'), |
| 110 | - 'middleware' => ['bindings'], |
|
| 110 | + 'middleware' => [ 'bindings' ], |
|
| 111 | 111 | ]; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | private function registerAuthRoutes() |
| 115 | 115 | { |
| 116 | - Route::group($this->authRouteConfiguration(), function () { |
|
| 117 | - $this->loadRoutesFrom(__DIR__.'/../routes/auth.php'); |
|
| 116 | + Route::group($this->authRouteConfiguration(), function() { |
|
| 117 | + $this->loadRoutesFrom(__DIR__ . '/../routes/auth.php'); |
|
| 118 | 118 | }); |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | private function registerUserAuthRoutes() |
| 122 | 122 | { |
| 123 | - Route::group($this->authRouteConfiguration(), function () { |
|
| 124 | - $this->loadRoutesFrom(__DIR__.'/../routes/users-auth.php'); |
|
| 123 | + Route::group($this->authRouteConfiguration(), function() { |
|
| 124 | + $this->loadRoutesFrom(__DIR__ . '/../routes/users-auth.php'); |
|
| 125 | 125 | }); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function register() |
| 134 | 134 | { |
| 135 | - $this->mergeConfigFrom(__DIR__.'/../config/faithgen-sdk.php', 'faithgen-sdk'); |
|
| 135 | + $this->mergeConfigFrom(__DIR__ . '/../config/faithgen-sdk.php', 'faithgen-sdk'); |
|
| 136 | 136 | |
| 137 | 137 | $this->app->singleton(ProfileService::class); |
| 138 | 138 | $this->app->singleton(ImageService::class); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | use CreatableTrait; |
| 26 | 26 | |
| 27 | 27 | protected $table = 'fg_ministries'; |
| 28 | - protected $guarded = ['id']; |
|
| 28 | + protected $guarded = [ 'id' ]; |
|
| 29 | 29 | public $incrementing = false; |
| 30 | 30 | protected $hidden = [ |
| 31 | 31 | 'password', |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | 'updated_at', |
| 34 | 34 | ]; |
| 35 | 35 | |
| 36 | - public const ACCOUNT_LEVELS = ['Free', 'Premium', 'PremiumPlus']; |
|
| 36 | + public const ACCOUNT_LEVELS = [ 'Free', 'Premium', 'PremiumPlus' ]; |
|
| 37 | 37 | |
| 38 | 38 | public function getJWTIdentifier() |
| 39 | 39 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function getJWTCustomClaims() |
| 44 | 44 | { |
| 45 | - return []; |
|
| 45 | + return [ ]; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | return $phones; |
| 112 | 112 | } else { |
| 113 | - return [$this->phone]; |
|
| 113 | + return [ $this->phone ]; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | return $emails; |
| 124 | 124 | } else { |
| 125 | - return [$this->email]; |
|
| 125 | + return [ $this->email ]; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | public function getUsersAttribute() |
| 150 | 150 | { |
| 151 | 151 | return $this->ministryUsers() |
| 152 | - ->map(fn ($minUser) => $minUser->user) |
|
| 152 | + ->map(fn($minUser) => $minUser->user) |
|
| 153 | 153 | ->flatten(); |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | use Illuminate\Support\Facades\Hash; |
| 12 | 12 | use Illuminate\Support\Str; |
| 13 | 13 | |
| 14 | -$factory->define(\FaithGen\SDK\Models\Ministry::class, function (Faker $faker) { |
|
| 14 | +$factory->define(\FaithGen\SDK\Models\Ministry::class, function(Faker $faker) { |
|
| 15 | 15 | return [ |
| 16 | 16 | 'name' => $faker->company, |
| 17 | 17 | 'email' => $faker->safeEmail, |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | ]; |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | -$factory->define(Profile::class, function (Faker $faker) { |
|
| 26 | +$factory->define(Profile::class, function(Faker $faker) { |
|
| 27 | 27 | return [ |
| 28 | 28 | 'id' => Str::uuid()->toString(), |
| 29 | 29 | 'about_us' => $faker->randomHtml(2, 3), |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | ]; |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | -$factory->define(Account::class, function () { |
|
| 49 | +$factory->define(Account::class, function() { |
|
| 50 | 50 | return [ |
| 51 | 51 | 'id' => Str::uuid()->toString(), |
| 52 | 52 | ]; |
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | -$factory->define(Activation::class, function (Faker $faker) { |
|
| 55 | +$factory->define(Activation::class, function(Faker $faker) { |
|
| 56 | 56 | return [ |
| 57 | 57 | 'id' => Str::uuid()->toString(), |
| 58 | 58 | 'code' => $faker->randomNumber(7), |
@@ -60,17 +60,17 @@ discard block |
||
| 60 | 60 | ]; |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | -$factory->define(Ministry\APIKey::class, function () { |
|
| 63 | +$factory->define(Ministry\APIKey::class, function() { |
|
| 64 | 64 | return [ |
| 65 | 65 | 'id' => Str::uuid()->toString(), |
| 66 | 66 | 'api_key' => str_shuffle(Str::uuid()->toString()), |
| 67 | 67 | ]; |
| 68 | 68 | }); |
| 69 | 69 | |
| 70 | -$factory->define(Ministry\DailyService::class, function (Faker $faker) { |
|
| 70 | +$factory->define(Ministry\DailyService::class, function(Faker $faker) { |
|
| 71 | 71 | return [ |
| 72 | 72 | 'id' => Str::uuid()->toString(), |
| 73 | - 'day' => Helper::$weekDays[(rand(0, count(Helper::$weekDays) - 1))], |
|
| 73 | + 'day' => Helper::$weekDays[ (rand(0, count(Helper::$weekDays) - 1)) ], |
|
| 74 | 74 | 'alias' => $faker->word, |
| 75 | 75 | 'start' => '08:00', |
| 76 | 76 | 'finish' => '11:00', |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | use Illuminate\Support\Facades\Hash; |
| 10 | 10 | use Illuminate\Support\Str; |
| 11 | 11 | |
| 12 | -$factory->define(User::class, function (Faker $faker) { |
|
| 12 | +$factory->define(User::class, function(Faker $faker) { |
|
| 13 | 13 | return [ |
| 14 | 14 | 'id' => Str::uuid()->toString(), |
| 15 | 15 | 'name' => $faker->name, |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | ]; |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | -$factory->define(MinistryUser::class, function (Faker $faker) { |
|
| 22 | +$factory->define(MinistryUser::class, function(Faker $faker) { |
|
| 23 | 23 | return [ |
| 24 | 24 | 'ministry_id' => Ministry::inRandomOrder()->first()->id, |
| 25 | 25 | 'id' => Str::uuid()->toString(), |