V
V
VladimirKrasnov2021-03-08 08:28:14
Laravel
VladimirKrasnov, 2021-03-08 08:28:14

Why do routes stop working after Laravel update?

After upgrading to Laravel 7, all routes stopped working. On all pages an error is produced Missing required parameters for Route, although I pass the parameters.

Here is one of the many routes that looks like this

Route::get('/{nickname}', '[email protected]')->name('profile');

In the template, the link to this route was like this
{{route('profile', ['nickname' => $user->nickname])}}

Now, in order for the whole thing to work, you don’t have to pass an array as the second parameter, so there are thousands of such routes in the project and I don’t feel like fixing this whole thing by hand. Is there any treatment for this problem?
{{route('profile', $user->nickname)}}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
part_os, 2021-03-08
@part_os

php artisan cache:clear
php artisan route:clear
You can also look at all the routes in the console to make sure they are correct.
php artisan route:list

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question