laravel route namespace and prefix
Route::prefix('admin')->group(function () {
Route::get('/users', function () {
// Matches The "/admin/users" URL
});
});
laravel route namespace and prefix
Route::prefix('admin')->group(function () {
Route::get('/users', function () {
// Matches The "/admin/users" URL
});
});
laravel route namespace and prefix
Route::name('admin.')->group(function () {
Route::get('/users', function () {
// Route assigned name "admin.users"...
})->name('users');
});
laravel 8 routes namespace
Route::group(['namespace' => 'App\Http\Controllers', 'prefix' => 'admin',
'as' => 'admin.', 'middleware' => ['auth:sanctum', 'verified']], function()
{
Route::get('/dashboard', ['DashboardController', 'index']);
});
what is route namespace in laravel
Route::namespace('Admin')->group(function () {
// Controllers Within The "App\Http\Controllers\Admin" Namespace
});
laravel route namespace and prefix
Route::get('/user/{name?}', function ($name = null) {
return $name;
});
Route::get('/user/{name?}', function ($name = 'John') {
return $name;
});
laravel route namespace and prefix
use App\Models\User;
Route::get('/users/{user}', function (User $user) {
return $user->email;
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us