i have travel website working with category and sub category EX: Link (1) : tours/egypt/cairo Link (2) : tours/uae/cairo
if you open link 1 you will get tours inside cairo if you change egypt to uae and with same city get the same tours
in DATABASE Egypt -cairo
UAE
Route.php
Route::bind('toursection', function($id) { $toursection = \App\Models\TourSection::where('slug', $id)->first(); if (is_null($toursection)) App::abort(404, 'Page not found'); return $toursection; });
Route::bind('tourcategory', function($toursection, $id) { $tourcategory = \App\Models\TourCategory::where('slug', $toursection, $id)->first(); if (is_null($tourcategory)) App::abort(404, 'Page not found'); return $tourcategory; });
Route::get('tours/', 'Frontend\ToursController@index'); Route::get('tours/{toursection}', 'Frontend\ToursController@sectionIndex'); Route::get('tours/{toursection}/{tourcategory}', 'Frontend\ToursController@categoryIndex'); Route::get('tours/{toursection}/{tourcategory}/{slug}', 'Frontend\ToursController@show');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community