I am now beginning to understand Laravel's routing system, and I have a question about Middlewares. Can I have two equal routing for the same vector where, when my user is authenticated, will the return of this routing be different? Example:
Route::get('/', function () {
return 'Página Inicial';
});
Route::group(['middleware' => 'auth'], function () {
Route::get('/', function () {
return 'Painel de controle do usuário autenticado';
});
});
If this is not possible, what is the best way to change the function of a route when a user exists?