Support the ongoing development of Laravel.io →
posted 8 years ago
Requests
Last updated 1 year ago.
0

Looks like optional parameters aren't supported by the Lumen routing package.

0

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);

});
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Blackpig blackpig Joined 6 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.