Home > Mobile >  I was trying to access "UserController@edit" but it doesn't found, what did i do wron
I was trying to access "UserController@edit" but it doesn't found, what did i do wron

Time:06-18

This is my link

<a href="{{ url($i->id.'/edit') }}">edit</a>

This is my web.php

Route::resource('/', UserController::class);

When i run php artisan route:list this is the return

GET|HEAD | {}/edit | edit | App\Http\Controllers\UserController@edit | web

CodePudding user response:

It should be

<a href="{{ route('user.edit', $i->id) }}">edit</a>

and

Route::resource('user', UserController::class);

The first argument of the resource should be the name of the route group and not the route.

  • Related