class FooController extends Controller
{
public function index($optional_parameter = 'default value')
{
// ...
}
}
Aug 6, 2015
9
Level 1
Default route parameter values
Hi, i'm trying to find out how to set the default value of a route parameter, so that if it doesn't exist when building the route, the default value is used in its place.
There's a section here http://laravel.com/docs/5.0/routing#route-parameters under "Optional Route Parameters With Default Value" which suggests you can set default values, but can't see how to set them in named routes.
Please or to participate in this conversation.