Unable to prepare route [api/user] for serialization. Uses Closure

Posted by

Error

I’m writing my project on Laravel. When I optimize the project, I have a problem :

Unable to prepare route [api/new-user-activated] for serialization. Another route has already been assigned name [new-user-activated]

Solution:

Step 1:

in api.php file search and comment this route you will not get error..

and also inĀ web.phpĀ fileĀ route::groupĀ is alsoĀ closureĀ and also comment them for test

Route::group(['middleware' => 'admin','prefix' => 'admin'],function () {
    Route::get('/', 'HomeController@index')->name('admin');
    Route::get('/reviews', 'Admin\ReviewsController@get')->name('admin.reviews');
    Route::get('/reviews/accepted/{id}','Admin\ReviewsController@accept')->where('id','\d+')->name('admin.accepted');
    Route::delete('/reviews/delete','Admin\ReviewsController@delete')->name('reviews.delete');
});

Php routing cache command :

php artisan route:cache
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x