laarvel route group example
Example 1: laravel route namespace and prefix
Route::name('admin.')->group(function () {
Route::get('/users', function () {
// Route assigned name "admin.users"...
})->name('users');
});
Example 2: laravel route namespace and prefix
use App\Models\User;
Route::get('/users/{user}', function (User $user) {
return $user->email;
});