Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I was trying to access "UserController@edit" but it doesn't found, what did i do wrong?

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading