Route::resource('products', 'ProductsController');
so I have this route in the meantime, and I want to change it to
Route::resource('{store}/products', 'ProductsController', [
function($store) {
$store = App\Models\Store::where('slug', $store)->firstOrFail();
}
]);
is this correct? what would my controller functions look like? should I add $store in each functions I am going to use?
or should I do the long way where I have to do it like Route::get, Route::post...
EDIT: or should I do a Route::group?