Search code examples
laravellaravel-routing

Unable to prepare route [password/reset] for serialization. Another route has already been assigned name [password.request]


I have created a small application in Laravel 8. Everything is fine, but when I wanted to configure the cache I had an error that one route has the same name as another.

Reviewing the routes I found duplicate named routes, but since I'm new to Laravel, I don't know how to solve this problem. I do not know what to do to have two routes with the same name I hope you can guide me a bit.

Screenshot output of php artisan route:list


Solution

  • Just override the laravel auth routes

    Route::post('password/email', [
        'as' => 'laravel.password.email',
        'uses' => 'App\Http\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail'
    ]);
    
    Route::get('password/reset', [
        'as' => 'laravel.password.request',
        'uses' => 'App\Http\Controllers\Auth\ForgotPasswordController@showLinkRequestForm'
    ]);
    

    But dont forget to change the old route names