assume a set of routes with a pre-filter using something like:
Route::group(['before' => 'subdomain'], function() { .. Route::get( 'subroute/{sub?}', controller_name@function_name ) .. }
in the filter "subdomain", I set a parameter to carry with the route:
$thisRoute->setParameter('pname",pvalue)
now, the controller function looks like:
function_name( $sub = 'optional' ) {
dd($sub)
}
what happens is that $sub is never set to 'optional' and instead is set to the value of pname in the filter.
is there a correct way to do this so that $sub doesn't get mixed up with pname?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community