Home > Net >  Route [...] not defined even though it exists on Laravel 9.37.0
Route [...] not defined even though it exists on Laravel 9.37.0

Time:12-02

So I'm working on an application on Laravel, and I'm running into the issue. A route that I have defined in my web.php is said to not exist : the error

I have already looked up here about people having a similar problem, but none of the solution I have found worked. I really don't know what to do to be honest so I'm taking any idea you can come up with.

By the way, it is in my route:list route:list

This is the code in my view :

<a href="{{route('categorie', $service->id)}}" ><i ></i></a>

And there is the code in my web.php :

Route::resource('service', ServiceController::class);
Route::resource('categorie', CategorieController::class);
Route::resource('ticket', TicketController::class);

I tried to make a new Route::get and add a name('categorie') but i won't work either, and it's not a surprise since Route::resource is supposed to already make named route, but it was worth to try.

Thanks in advance.

CodePudding user response:

You need to use categorie.show

<a href="{{route('categorie.show', $service->id)}}" ><i ></i></a>
  • Related