Syzyf37
Syzyf37

Reputation: 11

Problem with routing after installing UI in Laravel 9

In the new Laravel 9 project, after installing the UI, I have a problem with the php artisan route:cache command. Message appears:

Unable to prepare route [password/reset] for serialization. Another route has already been assigned name [password.request]. Checking route:list, no duplicate route.

Everything is fine on the local server, but some routes are not working on the hosting.

Upvotes: 1

Views: 233

Answers (2)

rob
rob

Reputation: 8410

First find the details of the duplicates

php artisan route:list --name=password.request

For me this showed

+--------+----------+-----------------+------------------+------------------------------------------------------------------------+-------------------------------------------------+
| Domain | Method   | URI             | Name             | Action                                                                 | Middleware                                      |
+--------+----------+-----------------+------------------+------------------------------------------------------------------------+-------------------------------------------------+
|        | GET|HEAD | forgot-password | password.request | Laravel\Fortify\Http\Controllers\PasswordResetLinkController@create    | web                                             |
|        |          |                 |                  |                                                                        | App\Http\Middleware\RedirectIfAuthenticated:web |
|        | GET|HEAD | password/reset  | password.request | App\Http\Controllers\Auth\ForgotPasswordController@showLinkRequestForm | web                                             |
|        |          |                 |                  |                                                                        | App\Http\Middleware\Cors                        |
+--------+----------+-----------------+------------------+------------------------------------------------------------------------+-------------------------------------------------+

Which led to the routes/web.php file that had the default

Auth::routes();

removing this line (I knew the alternate authorisation package was in place) and re-running

php artisan route:cache

fixed the conflict.

Upvotes: 0

NickolasBini
NickolasBini

Reputation: 46

Are the names of those route not the same?

By the name I mean the "name" method as follow bellow:

Route::get('/user', [UserController::class, 'index'])->name('thisMustBeAnUniqueName);

Upvotes: 0

Related Questions