Laravel Route Groups (Laravel 4)
I just found out that in Laravel you can add groups to your routes. Say for instance that you need to apply an authentication filter inside many routes. Instead of adding that filter through each and every route you can wrap them inside a group.
For example:
/**
* Unauthenticated routes
**/
Route::group(array('before' => 'guest'), function()
{
Route::get('/', function()
{
// Has guest Filter
});
Route::get('user/create', function()
{
// Has guest Filter
});
});
As you can see, Laravel route groups can be useful for grouping authenticated routes and unauthenticated routes with their needed filters.
Resources
Route Groups: http://laravel.com/docs/routing#route-groups