i have categories variable which basically gets all the data from category table and it is common for all the pages. So far i am injecting it to view from the controller.
I want to know is there anyway in the routes where i can specify the category and it will be available for all the routes inside that group rather then injecting it into view from controller ??
Something like this
Route::group(['namespace' => 'Frontend'], function ($category = Category::all()) {
Route::get('/', 'HomeController@welcome')->name('welcome');
Route::get('/c/{slug}','HomeController@category')->name('frontend.category');
.......
..........
});
Is it possible ?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire