Answers for "get route id in laravel"

PHP
0

laravel route Accessing The Current Route

$route = Route::current();

$name = Route::currentRouteName();

$action = Route::currentRouteAction();
Posted by: Guest on July-24-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 pattern

Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
    // Only executed if {id} is numeric...
});
Posted by: Guest on May-18-2020
0

laravel route name routes

Route::get('user/profile', function () {
    //
})->name('profile');
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language