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
});
});
set route name laravel
Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');
Route::get('/novanoticia', ['as' => 'route_name', 'uses' => 'HomeController@getNovaNoticia']);
laravel route
Route::get('user/{id}', function ($id) {
return 'User '.$id;
});
laravel route
Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
laravel route optional parameter
Route::get('/sample/{param?}', 'SampleController@index');
laravel route optional parameter
// You can make a parameter optional by placing a '?' after the parameter name.
// Make sure to give the route's corresponding variable a default value:
Route::get('user/{name?}', function ($name = null) {
return $name;
});
Route::get('user/{name?}', function ($name = 'John') {
return $name;
});
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