You need to add the slug in the route
<a class="nav-link" href="{{ route('about', $slug) }}">
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I installed cviebrock/eloquent-sluggable package.
I have an issue with the URLs i.e., with the hrefs and slug.
menu.blade.php
<a class="nav-link" href="{{ route('about') }}">
web.php
Route::get('content/{contentSlug}', 'PageController@content')->name('about');
RouteServiceProvider.php
Route::bind('contentSlug', function ($value) {
return Page::whereSlug($value)->firstOrFail();
});
I get this error
Illuminate\Routing\Exceptions\UrlGenerationException Missing required parameters for [Route: about] [URI: en/content/{contentSlug}]. (
Do this
@php
$page = Page::first();
@endPHP
<a class="nav-link" href="{{ route('about', $page->slug }}">
This is just an example of how you want to use that route, you should do it however you normally would with MVC pattern
Please or to participate in this conversation.