DEV Community

Discussion on: Creating Your First Blog With TALL - Part Five

Collapse
 
nayi10 profile image
Alhassan Kamil

@johnjehunglin sorry for the late reply. I'm very busy recently and actually never thought I'd receive notifications again.

But coming to your issue, did you pass on the slug for the detail route as required below:

Route::get('{slug}', function ($slug) {
return view('welcome');
})->name('post-detail');

There may be one of two problems: either the slug column is missing from your posts table or the slug wasn't passed. If you read the tutorial series to the end, you'd see that I later modified the posts table to accommodate the slug column.

Collapse
 
pablo_rica profile image
Pablo Rica

Also, you can generate an slug in the Livewire component using Illuminate\Support\Str

//use Illuminate\Support\Str;
    public function render() {
        $this->post->slug = Str::slug($this->post->post_title);
        return view('livewire.post-item');
    }
Enter fullscreen mode Exit fullscreen mode