Looks like optional parameters aren't supported by the Lumen routing package.
yeah. probably you can do it like this:
$app->get('/{type:[A-Za-z]?}/{route:[A-Za-z]?}', function($type='profile', $route='home') use ($app) {
$viewName[] = ["prototype", $type];
$viewName[] = ( $route ) ? str_replace('/', '.', $route) : '';
$viewName = implode('.', $viewName);
return view($viewName);
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community