Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shahr's avatar
Level 10

Missing required parameters for [Route: about] [URI: en/content/{contentSlug}].

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}]. (

0 likes
16 replies
devingray_'s avatar

You need to add the slug in the route

<a class="nav-link" href="{{ route('about', $slug) }}">
1 like
shahr's avatar
Level 10

It has error

Undefined variable: slug

devingray_'s avatar

Obviously... You need to add the slug from your data.

You are accessing a route that requires a parameter {contentSlug} and you are not passing the slug to that route

devingray_'s avatar
Level 8

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

2 likes
MichalOravec's avatar

@devingray_ This user has really bad behavior on this forum.

His usually phrases are

Answer my question

I am in hurry

Everytime when he doesn't get an answer, he changed a text a little bit to got the thread to the top, or he created a new one.

He ask really silly question like this, and it's really obvious what the problem is. So many people told him that he has to learn and he just promises he will do that in the next project.

It's same person as @oxbir (it's this account), @iroxbir and @irankhosravi

Just for example he created this thread

https://laracasts.com/discuss/channels/laravel/how-to-send-email-using-laravel

Which is same as 5 years old thread on stackoverflow

https://stackoverflow.com/questions/35830567/how-to-send-email-using-laravel/35830811

And I can continue a whole day.

devingray_'s avatar

Got it. Thats a shame, this community is awesome, so having that attitude really sucks. Will pay attention to this in future

devingray_'s avatar

@michaloravec Yeah I had a poke around, and I am not sure what the issue is here, I actually doubt that these are real world problems, it seems all posts are just trolls for attention

Please or to participate in this conversation.