@@ -29,7 +29,7 @@ |
||
| 29 | 29 | 'avatar' => ImageHelper::getImage('sermons', $this->image, config('faithgen-sdk.ministries-server')), |
| 30 | 30 | ], |
| 31 | 31 | 'date' => Helper::getDates(Carbon::parse($this->date)), |
| 32 | - 'resource' => $this['resource'], |
|
| 32 | + 'resource' => $this[ 'resource' ], |
|
| 33 | 33 | 'verses' => [ |
| 34 | 34 | 'main' => $this->main_verses, |
| 35 | 35 | 'reference' => $this->reference_verses, |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $sermons = auth()->user() |
| 55 | 55 | ->sermons() |
| 56 | 56 | ->latest() |
| 57 | - ->where(fn ($sermon) => $sermon->search(['preacher', 'title', 'preacher'], $request->filter_text)) |
|
| 57 | + ->where(fn($sermon) => $sermon->search([ 'preacher', 'title', 'preacher' ], $request->filter_text)) |
|
| 58 | 58 | ->paginate(Helper::getLimit($request)); |
| 59 | 59 | |
| 60 | 60 | SermonResource::wrap('sermons'); |
@@ -13,22 +13,22 @@ |
||
| 13 | 13 | |
| 14 | 14 | public static function getImageLink($imageName, int $dimen = 0) |
| 15 | 15 | { |
| 16 | - if (! $imageName) { |
|
| 16 | + if (!$imageName) { |
|
| 17 | 17 | return MinistryHelper::getImageLink(auth()->user(), $dimen); |
| 18 | 18 | } |
| 19 | - if (! $dimen) { |
|
| 20 | - return SDK::getAsset('storage/sermons/original/'.$imageName); |
|
| 19 | + if (!$dimen) { |
|
| 20 | + return SDK::getAsset('storage/sermons/original/' . $imageName); |
|
| 21 | 21 | } else { |
| 22 | - return SDK::getAsset('storage/sermons/'.$dimen.'-'.$dimen.'/'.$imageName); |
|
| 22 | + return SDK::getAsset('storage/sermons/' . $dimen . '-' . $dimen . '/' . $imageName); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function getAvatar(Sermon $sermon) |
| 27 | 27 | { |
| 28 | 28 | return [ |
| 29 | - '_50' => ! $sermon->image()->exists() ? self::getImageLink(null, 50) : self::getImageLink($sermon->image->name, 50), |
|
| 30 | - '_100' => ! $sermon->image()->exists() ? self::getImageLink(null, 100) : self::getImageLink($sermon->image->name, 100), |
|
| 31 | - 'original' => ! $sermon->image()->exists() ? self::getImageLink(null, 0) : self::getImageLink($sermon->image->name, 0), |
|
| 29 | + '_50' => !$sermon->image()->exists() ? self::getImageLink(null, 50) : self::getImageLink($sermon->image->name, 50), |
|
| 30 | + '_100' => !$sermon->image()->exists() ? self::getImageLink(null, 100) : self::getImageLink($sermon->image->name, 100), |
|
| 31 | + 'original' => !$sermon->image()->exists() ? self::getImageLink(null, 0) : self::getImageLink($sermon->image->name, 0), |
|
| 32 | 32 | ]; |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -19,22 +19,22 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function boot() |
| 21 | 21 | { |
| 22 | - $this->registerRoutes(__DIR__.'/../../routes/sermons.php', __DIR__.'/../../routes/source.php'); |
|
| 22 | + $this->registerRoutes(__DIR__ . '/../../routes/sermons.php', __DIR__ . '/../../routes/source.php'); |
|
| 23 | 23 | |
| 24 | - $this->setUpSourceFiles(function () { |
|
| 25 | - $this->loadMigrationsFrom(__DIR__.'/../../database/migrations/'); |
|
| 24 | + $this->setUpSourceFiles(function() { |
|
| 25 | + $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations/'); |
|
| 26 | 26 | |
| 27 | 27 | $this->publishes([ |
| 28 | - __DIR__.'/../../database/migrations/' => database_path('migrations'), |
|
| 28 | + __DIR__ . '/../../database/migrations/' => database_path('migrations'), |
|
| 29 | 29 | ], 'faithgen-sermons-migrations'); |
| 30 | 30 | |
| 31 | 31 | $this->publishes([ |
| 32 | - __DIR__.'/../../storage/sermons/' => storage_path('app/public/sermons'), |
|
| 32 | + __DIR__ . '/../../storage/sermons/' => storage_path('app/public/sermons'), |
|
| 33 | 33 | ], 'faithgen-sermons-storage'); |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | 36 | $this->publishes([ |
| 37 | - __DIR__.'/../../config/faithgen-sermons.php' => config_path('faithgen-sermons.php'), |
|
| 37 | + __DIR__ . '/../../config/faithgen-sermons.php' => config_path('faithgen-sermons.php'), |
|
| 38 | 38 | ], 'faithgen-sermons-config'); |
| 39 | 39 | |
| 40 | 40 | Sermon::observe(SermonObserver::class); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function register() |
| 49 | 49 | { |
| 50 | - $this->mergeConfigFrom(__DIR__.'/../../config/faithgen-sermons.php', 'faithgen-sermons'); |
|
| 50 | + $this->mergeConfigFrom(__DIR__ . '/../../config/faithgen-sermons.php', 'faithgen-sermons'); |
|
| 51 | 51 | |
| 52 | 52 | $this->app->singleton(SermonService::class); |
| 53 | 53 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | public function getUnsetFields() |
| 35 | 35 | { |
| 36 | - return ['sermon_id', 'image']; |
|
| 36 | + return [ 'sermon_id', 'image' ]; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function getModel() |
@@ -9,9 +9,9 @@ |
||
| 9 | 9 | Route::name('sermons.') |
| 10 | 10 | ->prefix('sermons/') |
| 11 | 11 | ->middleware('source.site') |
| 12 | - ->group(function () { |
|
| 13 | - Route::post('create', [SermonController::class, 'create']); |
|
| 14 | - Route::delete('delete', [SermonController::class, 'delete']); |
|
| 15 | - Route::post('/update-picture', [SermonController::class, 'updatePicture']); |
|
| 16 | - Route::post('/update', [SermonController::class, 'update']); |
|
| 12 | + ->group(function() { |
|
| 13 | + Route::post('create', [ SermonController::class, 'create' ]); |
|
| 14 | + Route::delete('delete', [ SermonController::class, 'delete' ]); |
|
| 15 | + Route::post('/update-picture', [ SermonController::class, 'updatePicture' ]); |
|
| 16 | + Route::post('/update', [ SermonController::class, 'update' ]); |
|
| 17 | 17 | }); |
@@ -6,9 +6,9 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * Handles sermons details. |
| 8 | 8 | */ |
| 9 | -Route::name('sermons.')->prefix('sermons/')->group(function () { |
|
| 10 | - Route::get('/', [SermonController::class, 'index']); |
|
| 11 | - Route::get('/{sermon}', [SermonController::class, 'view']); |
|
| 12 | - Route::get('comments/{sermon}', [SermonController::class, 'comments']); |
|
| 13 | - Route::post('comment', [SermonController::class, 'comment']); |
|
| 9 | +Route::name('sermons.')->prefix('sermons/')->group(function() { |
|
| 10 | + Route::get('/', [ SermonController::class, 'index' ]); |
|
| 11 | + Route::get('/{sermon}', [ SermonController::class, 'view' ]); |
|
| 12 | + Route::get('comments/{sermon}', [ SermonController::class, 'comments' ]); |
|
| 13 | + Route::post('comment', [ SermonController::class, 'comment' ]); |
|
| 14 | 14 | }); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('fg_sermons', function (Blueprint $table) { |
|
| 16 | + Schema::create('fg_sermons', function(Blueprint $table) { |
|
| 17 | 17 | $table->string('id', 150)->primary(); |
| 18 | 18 | $table->string('ministry_id', 150)->index(); |
| 19 | 19 | $table->string('title'); |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | return true; |
| 38 | 38 | } else { |
| 39 | 39 | $sermonsCount = Sermon::where('ministry_id', $user->id) |
| 40 | - ->whereBetween('created_at', [now()->firstOfMonth(), now()->lastOfMonth()]) |
|
| 40 | + ->whereBetween('created_at', [ now()->firstOfMonth(), now()->lastOfMonth() ]) |
|
| 41 | 41 | ->count(); |
| 42 | 42 | if ($sermonsCount >= SermonHelper::$freeSermonsCount) { |
| 43 | 43 | return false; |