Answers for "laravel route name pass parameter"

PHP
0

passing parameters with route keyword in blade laravel

<a href="{{ route('blog.by.slug', ['slug' => 'someslug']) }}">...</a>
Posted by: Guest on June-19-2021
5

named route with parameter laravel

Route::get('/menu/{category}/{product}/{item}', ['as' => 'named.route' , 'uses' => 'MenuController@listItem']);

// to get the actual linke
route('named.route', ['category' => $category->id, 'product' => $product->id, 'item' => $item->id]);
Posted by: Guest on May-29-2020
2

laravel route

Route::get('user/profile', [UserProfileController::class, 'show'])->name('profile');
Posted by: Guest on October-07-2020
0

route parameter type laravel

Route::get('/user/{name}', function ($name) {
    //
})->where('name', '[A-Za-z]+');

Route::get('/user/{id}', function ($id) {
    //
})->where('id', '[0-9]+');

Route::get('/user/{id}/{name}', function ($id, $name) {
    //
})->where(['id' => '[0-9]+', 'name' => '[a-z]+']);

reference : https://laravel.com/docs/8.x/routing#parameters-regular-expression-constraints
Posted by: Guest on December-13-2020

Code answers related to "laravel route name pass parameter"

Browse Popular Code Answers by Language