diff --git a/app/Livewire/BlogView.php b/app/Livewire/BlogView.php index 5297b54..59cbee1 100644 --- a/app/Livewire/BlogView.php +++ b/app/Livewire/BlogView.php @@ -2,6 +2,7 @@ namespace App\Livewire; +use App\Models\Blog; use Illuminate\View\View; use Livewire\Component; @@ -9,13 +10,13 @@ class BlogView extends Component { public $blog; - public function mount($blog): void + public function mount($slug): void { - $this->blog = $blog; + $this->blog = Blog::with(['user', 'images'])->where('slug', $slug)->first(); } public function render(): View { - return view('blogs.show')->layout('blogs.layout'); + return view('blogs.show')->layout('layouts.guest'); } } diff --git a/resources/views/livewire/blog-renderer.blade.php b/resources/views/livewire/blog-renderer.blade.php index d2c4659..8f1bb56 100644 --- a/resources/views/livewire/blog-renderer.blade.php +++ b/resources/views/livewire/blog-renderer.blade.php @@ -9,7 +9,7 @@