Route::prefix('admin')->group(function () {
Route::get('/users', function () {
// Matches The "/admin/users" URL
});
});
Route::group(['namespace' => 'AppHttpControllers', 'prefix' => 'admin',
'as' => 'admin.', 'middleware' => ['auth:sanctum', 'verified']], function()
{
Route::get('/dashboard', ['DashboardController', 'index']);
});
Route::name('admin.')->group(function () {
Route::get('/users', function () {
// Route assigned name "admin.users"...
})->name('users');
});
Route::get('/', [ControllerName::class, 'index'])->name('homeRoute');
Route::get('/user/{name?}', function ($name = null) {
return $name;
});
Route::get('/user/{name?}', function ($name = 'John') {
return $name;
});
Route::namespace('Admin')->group(function () {
// Controllers Within The "AppHttpControllersAdmin" Namespace
});
use AppModelsUser;
Route::get('/users/{user}', function (User $user) {
return $user->email;
});