Answers for "laravel route any"

PHP
7

laravel route list

php artisan route:list
Posted by: Guest on July-28-2020
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 get route

Route::get('/user', 'UserController@index');
Posted by: Guest on March-10-2020
4

laravel get route

Route::get('foo', function () {
    return 'Hello World';
});
Posted by: Guest on March-10-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

Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
    //
});
Posted by: Guest on April-22-2020

Browse Popular Code Answers by Language