1

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.

Senthurkumaran
  • 1,738
  • 2
  • 19
  • 29
tzcoding
  • 69
  • 6
  • please share your route and some functional code to help you – A.A Noman May 03 '20 at 10:50
  • `Route::get('events/', 'Events\EventsController@index')->name('events_page'); Route::get('events/', 'Events\EventsController@archive')->name('events_archive');` I haven't started making the function. – tzcoding May 03 '20 at 10:54
  • do you have `Group route prefix` top of this roure ? – Reza sh May 03 '20 at 11:03
  • 1
    you are giving different name to same route `events/`, change the method or give it a new route `events/archive`. – Mike Ross May 03 '20 at 11:35

1 Answers1

1

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');
Christophe Hubert
  • 2,833
  • 1
  • 12
  • 25