Good Day
I'm new to Laravel, and I want to create a website that has multiple users (Student, Supervisor, HOD). I want to know if there is a way to have all the users have the same URLs. Below is the approach I used to try to achieve this:
web.php
// Routes For Students
Route::group(['middleware' => ['auth', 'role:student']], function() {
Route::get('/home', 'App\Http\Controllers\StudentController@index')->name('student');
Route::get('/proposal', 'App\Http\Controllers\StudentController@proposal')->name('proposal');
Route::get('/thesis', 'App\Http\Controllers\StudentController@thesis')->name('thesis');
});
// Routes For Supervisors
Route::group(['middleware' => ['auth', 'role:supervisor']], function() {
Route::get('/home', 'App\Http\Controllers\supervisorController@index')->name('supervisor');
Route::get('/proposal', 'App\Http\Controllers\supervisorController@proposal')->name('proposal');
Route::get('/thesis', 'App\Http\Controllers\supervisorController@thesis')->name('thesis');
});
// Routes For HOD's
Route::group(['middleware' => ['auth', 'role:hod']], function() {
Route::get('/home', 'App\Http\Controllers\hodController@index')->name('hod');
Route::get('/proposal', 'App\Http\Controllers\hodController@proposal')->name('proposal');
Route::get('/thesis', 'App\Http\Controllers\hodController@thesis')->name('thesis');
});
However I noticed that you cannot have routes with the same URL, but I want all types of users to have the same URL for their respective home, proposal & thesis pages. Is this possible?
Please let me know if you require more code or a better explanation.