@@ -15,7 +15,7 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | protected function redirectTo($request) |
| 17 | 17 | { |
| 18 | - if (! $request->expectsJson()) { |
|
| 18 | + if (!$request->expectsJson()) { |
|
| 19 | 19 | return route('admin.login'); |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | $this->save(); |
| 120 | 120 | |
| 121 | 121 | if ($attributes['tags_text']) { |
| 122 | - $tags = array_map(function (string $tag) { |
|
| 122 | + $tags = array_map(function(string $tag) { |
|
| 123 | 123 | return trim(strtolower($tag)); |
| 124 | 124 | }, explode(',', $attributes['tags_text'])); |
| 125 | 125 | |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | 'error' => 'bg-red-500', |
| 46 | 46 | ]); |
| 47 | 47 | |
| 48 | - Menu::macro('blogAdminNavHeader', function () { |
|
| 48 | + Menu::macro('blogAdminNavHeader', function() { |
|
| 49 | 49 | return Menu::build( |
| 50 | 50 | config('blog.navHeader'), |
| 51 | - function (\Spatie\Menu\Laravel\Menu $menu, $view) { |
|
| 51 | + function(\Spatie\Menu\Laravel\Menu $menu, $view) { |
|
| 52 | 52 | $menu->add(View::create($view)->addParentClass('ml-5 lg:ml-6')); |
| 53 | 53 | }) |
| 54 | 54 | ->addClass('flex items-end lg:items-center lg:pr-2') |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | ->setActiveFromRequest('/'); |
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | - Menu::macro('blogAdminNav', function () { |
|
| 59 | + Menu::macro('blogAdminNav', function() { |
|
| 60 | 60 | return Menu::build( |
| 61 | 61 | config('blog.navAdmin'), |
| 62 | - function (\Spatie\Menu\Laravel\Menu $menu, $view) { |
|
| 62 | + function(\Spatie\Menu\Laravel\Menu $menu, $view) { |
|
| 63 | 63 | $menu->add(View::create($view)->addParentClass('')); |
| 64 | 64 | }) |
| 65 | 65 | ->addItemClass('p-2') |
@@ -108,21 +108,21 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | public function registerRouteModelBindings() |
| 110 | 110 | { |
| 111 | - Route::bind('postSlug', function ($slug) { |
|
| 111 | + Route::bind('postSlug', function($slug) { |
|
| 112 | 112 | if (auth()->check()) { |
| 113 | 113 | return Post::where('slug', $slug)->first() ?? abort(404); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $post = Post::where('slug', $slug)->public()->first() ?? abort(404); |
| 117 | 117 | |
| 118 | - if (! $post->published) { |
|
| 118 | + if (!$post->published) { |
|
| 119 | 119 | abort(404); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | return $post; |
| 123 | 123 | }); |
| 124 | 124 | |
| 125 | - Route::bind('tagSlug', function ($slug) { |
|
| 125 | + Route::bind('tagSlug', function($slug) { |
|
| 126 | 126 | return Tag::where('slug->en', $slug)->first() ?? abort(404); |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | ] |
| 77 | 77 | ); |
| 78 | 78 | // check if media table exists |
| 79 | - if (! Schema::hasTable('media')) { |
|
| 79 | + if (!Schema::hasTable('media')) { |
|
| 80 | 80 | $this->callSilent( |
| 81 | 81 | 'vendor:publish', |
| 82 | 82 | [ |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | '--provider' => TagsServiceProvider::class, |
| 109 | 109 | ] |
| 110 | 110 | ); |
| 111 | - if (! Schema::hasTable('tags')) { |
|
| 111 | + if (!Schema::hasTable('tags')) { |
|
| 112 | 112 | $this->callSilent( |
| 113 | 113 | 'vendor:publish', |
| 114 | 114 | [ |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function handle() |
| 28 | 28 | { |
| 29 | - if (! file_exists(base_path('theme/public'))) { |
|
| 29 | + if (!file_exists(base_path('theme/public'))) { |
|
| 30 | 30 | return $this->error('The theme doesn\'t have any public assets.'); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | public function getImagePixelDensity($image_url) |
| 72 | 72 | { |
| 73 | 73 | // Currently we support only imagick |
| 74 | - if (! \extension_loaded('imagick')) { |
|
| 74 | + if (!\extension_loaded('imagick')) { |
|
| 75 | 75 | return ''; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -11,14 +11,14 @@ discard block |
||
| 11 | 11 | // Admin routes |
| 12 | 12 | Route::middleware(['web', 'blog-nocache']) |
| 13 | 13 | ->prefix(config('blog.prefix')) |
| 14 | - ->group(function () { |
|
| 14 | + ->group(function() { |
|
| 15 | 15 | Route::get('login', [LoginController::class, 'showLoginForm'])->name('admin.login'); |
| 16 | 16 | Route::post('login', [LoginController::class, 'login']); |
| 17 | 17 | Route::post('logout', [LoginController::class, 'logout'])->name('admin.logout'); |
| 18 | 18 | // authorized routes |
| 19 | 19 | Route::middleware('blog-auth') |
| 20 | 20 | ->name('admin.') |
| 21 | - ->group(function () { |
|
| 21 | + ->group(function() { |
|
| 22 | 22 | Route::get('/', DashboardController::class)->name('dashboard'); |
| 23 | 23 | |
| 24 | 24 | Route::get('account', [AccountController::class, 'edit'])->name('account.edit'); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | }); |
| 32 | 32 | |
| 33 | 33 | Route::middleware(['web', 'blog-cacheResponse']) |
| 34 | - ->group(function () { |
|
| 34 | + ->group(function() { |
|
| 35 | 35 | Route::feeds(); |
| 36 | 36 | Route::get('/', HomeController::class); |
| 37 | 37 | Route::get('tag/{tagSlug}', TaggedPostsController::class)->name('posts.tagged'); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Faker\Generator as Faker; |
| 5 | 5 | use Wingsline\Blog\Posts\Post; |
| 6 | 6 | |
| 7 | -$factory->define(Post::class, function (Faker $faker) { |
|
| 7 | +$factory->define(Post::class, function(Faker $faker) { |
|
| 8 | 8 | return [ |
| 9 | 9 | 'title' => $faker->sentence, |
| 10 | 10 | 'text' => $faker->paragraph, |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function up() |
| 21 | 21 | { |
| 22 | - Schema::create('posts', function (Blueprint $table) { |
|
| 22 | + Schema::create('posts', function(Blueprint $table) { |
|
| 23 | 23 | $table->bigIncrements('id'); |
| 24 | 24 | $table->string('title', 255); |
| 25 | 25 | $table->string('slug', 255); |