You seem to be mixing full page component with component. For a regular component you need to pass the id
https://laravel-livewire.com/docs/2.x/rendering-components Find "Passing parameters"
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When I want to render the ShowPost component I faced this error
this is the route:
Route::get('/blog/{id}', function () { return view('pages/show-post'); })
this is the show-post.blade.php
@extends('pages.ShowLayout')
@section('content')
<header class="header-image ken-burn-center light" data-parallax="true" data-natural-height="1080" data-natural-width="1920" data-bleed="0" data-image-src="http://via.placeholder.com/1920x1080" data-offset="0" style="margin-top: 120px;">
<div class="container" style="margin-top: 0px; opacity: 1;">
<h1>{{ __("The Blog")}}</h1>
<h2>{{__("The best view comes after hardest climb")}}</h2>
<ol class="breadcrumb">
<li><a href="index.html">{{__('Home')}}</a></li>
<li><a href="#">{{__("Pages")}}</a></li>
<li><a href="#">{{__("Blog")}}</a></li>
</ol>
</div>
</header>
<main>
<section class="section-base section-color">
<div class="container">
<div class="row">
@livewire('blog.show-post')
@livewire('blog.categories')
</div>
</div>
</section>
</main>
and this is the component Class:
class ShowPost extends Component { public $post; public $local;
public function mount($id){
$this->local = app()->getLocale();
$this->post = Blog::find($id);
}
public function render()
{
return view('livewire.blog.show-post')
->extends('pages.ShowLayout')
->section('content');
}
}
You seem to be mixing full page component with component. For a regular component you need to pass the id
https://laravel-livewire.com/docs/2.x/rendering-components Find "Passing parameters"
Please or to participate in this conversation.