I want to remove one part of the URL to make the url shorter in the laravel application.
This is my routes definition:
Route::get('/category/{slug}','CourseController@courseCategory');
Route::get('/course/{slug}','CourseController@detail');
Example I have customer service and sleep care categories. And a course named Sleep care lvl 1. So I can access to the categories and courses by these links:
- mydomain.com/category/customer-service
- mydomain.com/category/sleep-care
- mydomain.com/course/sleep-care-lvl-1
May I know how can I make the URL shorter by removing category and course in the URL then the urls will become:
- mydomain.com/customer-service
- mydomain.com/sleep-care
- mydomain.com/sleep-care-lvl-1
Thank you very much!