Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel route optional parameters

Route::get('user/{name?}', function ($name = null) {
    return $name;
});

Route::get('user/{name?}', function ($name = 'John') {
    return $name;
});
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #route #optional #parameters
ADD COMMENT
Topic
Name
6+8 =