From 61c130fa19831ee15d0cc321b4f48e542731d46f Mon Sep 17 00:00:00 2001 From: atmonshi Date: Thu, 27 Jul 2023 14:29:29 +0000 Subject: [PATCH] Fix styling --- routes/web.php | 6 +++--- src/Http/Livewire/LibrarTag.php | 2 +- src/Models/Tag.php | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/routes/web.php b/routes/web.php index 66b322b..a1195e6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -39,7 +39,7 @@ ->first(); if ($post !== null) { - request()->session()->put($slug.'-'.request('password'), request('password')); + request()->session()->put($slug . '-' . request('password'), request('password')); return redirect()->route($post->post_type, ['slug' => $post->slug]); } @@ -49,8 +49,8 @@ ->name('passwordConfirmation'); Route::get('/', Posts::class)->name('blogs'); - Route::get(SkyPlugin::get()->getUriPrefix()['post'].'/{slug}', Post::class)->name('post'); - Route::get(SkyPlugin::get()->getUriPrefix()['page'].'/{slug}', Page::class)->name('page'); + Route::get(SkyPlugin::get()->getUriPrefix()['post'] . '/{slug}', Post::class)->name('post'); + Route::get(SkyPlugin::get()->getUriPrefix()['page'] . '/{slug}', Page::class)->name('page'); Route::get('{type}/{slug}', Tags::class)->name('tags'); }); } diff --git a/src/Http/Livewire/LibrarTag.php b/src/Http/Livewire/LibrarTag.php index 71eaa99..b968a14 100644 --- a/src/Http/Livewire/LibrarTag.php +++ b/src/Http/Livewire/LibrarTag.php @@ -11,7 +11,7 @@ class LibrarTag extends Component public function mount($slug) { - $this->tag = SkyPlugin::get()->getTagModel()::findBySlug($slug,'library'); + $this->tag = SkyPlugin::get()->getTagModel()::findBySlug($slug, 'library'); abort_if($this->tag === null, 404); } diff --git a/src/Models/Tag.php b/src/Models/Tag.php index bdc5075..c53784b 100644 --- a/src/Models/Tag.php +++ b/src/Models/Tag.php @@ -59,6 +59,7 @@ protected function generateSlug(string $locale): string public static function findBySlug(string $slug, string $type = null, string $locale = null): ?Model { $locale = $locale ?? static::getLocale(); + return static::query() ->where("slug->{$locale}", $slug) ->where('type', $type)