php - Can I group multiple domains in a routing group in Laravel? -
let's have following:
route::group(array('domain' => array('admin.example.com')), function() { ... }); route::group(array('domain' => array('app.example.com')), function() { ... }); route::group(array('domain' => array('dev.app.example.com')), function() { ... });
is there way have multiple domains share routing group? like:
route::group(array('domain' => array('dev.app.example.com','app.example.com')), function() { ... });
laravel not seem support this.
i'm not sure why didn't think of sooner, guess 1 solution declare routes in separate function pass both route groups.
route::group(array('domain' => 'admin.example.com'), function() { ... }); $approutes = function() { route::get('/',function(){ ... }); }; route::group(array('domain' => 'app.example.com'), $approutes); route::group(array('domain' => 'dev.app.example.com'), $approutes);
i'm not sure if there significant performance impact solution.
Comments
Post a Comment