Level 75
Jan 16, 2021
4
Level 3
php artisan route:list -> route is not listed (Laravel 5.5)
I have defined two routes in web.php:
Route::get('contact', 'ContactController@index')->name('contact.index');
Route::get('contact', 'ContactController@create')->name('contact.create');
When I do php artisan route:list, 'contact.index' is not listed:
GET|HEAD | contact | contact.create | App\Http\Controllers\ContactController@create | web
Why 'contact.index' is not presented in the list?
Many thanks!
Level 75
Oh ok, you have same uri contact there in both routes. The second one replace the first one.
So change it
Route::get('contact', 'ContactController@index')->name('contact.index');
Route::get('contact'/create, 'ContactController@create')->name('contact.create');
1 like
Please or to participate in this conversation.