3

In laravel 5.4 what is the best way to declare a resource route with slashes in the uri section?

For example in my routes/web.php I have:

Route::resource('/admin/settings', 'SettingController');

But if I have also this:

Route::resource('/settings', 'SettingController');

then laravel creates the same names for the routes which is in both cases settings.index, settings.store, settings.create etc...

tioschi
  • 389
  • 1
  • 3
  • 11

2 Answers2

4

Use dot notation:

Route::resource('admin.settings', 'SettingController');
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
  • 1
    Yes that did work out. I didn't know that I shouldn't use slashes in the uri argument of resource function. – tioschi Apr 19 '17 at 18:06
0

Dot in resource instead of slash.

 Route::resource('Demo.setting','DetailsController');
vishal pardeshi
  • 334
  • 4
  • 14