Argument: Web Routes

I'm in the final step of my app, then i would make a proper demo test for you! I need to tweak the web routes, more in depth I have 2 panels - Admin (for admin and technicians) - Customer (for client) When i create a customer (and related local user) i send an invitation email with a link to a 'choose your password' form The same when i create the Technician. The difference are that customer goes to Customer Panel and Technician to the Admin Panel Here i have the first problem, sometimes the customer goes to the admin panel, with error... Problems is in the route
/* Invitation */
Route::middleware('signed')->get('customer/invitation/{invitation}/accept', UserAcceptInvitation::class)->name('invitation.accept');
Route::middleware('signed')->get('admin/invitation/{invitation}/accept', TechnicianAcceptInvitation::class)->name('tech.invitation.accept');

Route::get('/', function () {
return view('welcome');
});

Route::get('/login', function () {
return redirect('/admin');
})->name('login');
/* Invitation */
Route::middleware('signed')->get('customer/invitation/{invitation}/accept', UserAcceptInvitation::class)->name('invitation.accept');
Route::middleware('signed')->get('admin/invitation/{invitation}/accept', TechnicianAcceptInvitation::class)->name('tech.invitation.accept');

Route::get('/', function () {
return view('welcome');
});

Route::get('/login', function () {
return redirect('/admin');
})->name('login');
Which is the best practice for this use case?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?