0

I am using laravel 4 and i have requirement like i want below two routes like this:

 Route::resource('admin/products', 'ProuctController');
 Route::post('admin/products', 'ProductController@index');

And It should treat like [admin.products.store] goes to store() and [admin.products] goes to index() .

Right now both routes goes to store() function of Product controller .

Is it possible to do like i am doing ??

Maha Dev
  • 3,915
  • 2
  • 31
  • 50

1 Answers1

1

Resource controllers can be given a subset of actions to register:

Route::resource('admin/products', 'ProuctController', [
    'except' => [ 'store' ]
]);

source: How to remove show() function from resource controller in Laravel

ali shojaei
  • 84
  • 1
  • 5