Laravel Route [events_page] not defined. error

238 Views Asked by At

I'm still making my events page, yet another error. I'm making an archive function and I've setup the route correctly, however now that I've created the "events_archive" route, "events_page" for some reason is playing up and throwing this error: Route [events_page] not defined.. It was all working until I made the archive route, do I have to make the controller function and then the error will fix?

Thanks.

1

There are 1 best solutions below

0
Christophe Hubert On

You routes have duplicate URI 'events/'

Route::get('events/', 'Events\EventsController@index')->name('events_page');
Route::get('events/', 'Events\EventsController@archive')->name('events_archive');

Make sure to make them unique such as:

Route::get('events/', 'Events\EventsController@index')->name('events_page');
Route::get('events_archive/', 'Events\EventsController@archive')->name('events_archive');