Laravel Bundle named routes missing/overridden or colliding
In my project I am using bundles to control different websites, depending
on the domain extension it loads the corresponding bundle. In all bundles
I am using named routes to access the actions in the controller, this is
part of my setup:
// BUNDLE A (manages website.a)
Route::get('(:bundle)/login', array('as' => 'bundle_a login', 'uses' =>
'bundle_a::home@login'));
// BUNDLE B (manages website.b)
Route::get('(:bundle)/login', array('as' => 'bundle_b login', 'uses' =>
'bundle_b::home@login'));
// BUNDLE C (manages webste.c)
Route::get('(:bundle)/login', array('as' => 'bundle_c login', 'uses' =>
'bundle_c::home@login'));
But when I try to create a URL in bundle_a of the login route of bundle_b
it shows the following error
Error creating URL for undefined route [bundle_b login]
So I echoed the registered routes with Router::routes() I see that the
route I want to use doesn't show up and I don't understand why, this is
the array i get:
login =>
as => bundle_a login,
uses => bundle_a::home@login,
https => false
login/(:any?)/(:any?)/(:any?)/(:any?)/(:any?) =>
uses => bundle_c::login@(:1),
defaults => index,
https => false
My question is what happens to the named route for the login for the
bundle_b? is it overridden? how can I avoid this?
No comments:
Post a Comment