Allow filter patterns to supply a name and callback as an easier alternative. #854

Merged
merged 2 commits into from Jul 7, 2012

3 participants

@jasonlewis

Currently you can only supply the name of a registered filter to filter patterns. This now allows you to supply a name and callback to the method to save on precious lines. ;)

Route::filter('pattern: admin/*', array('name' => 'admin.auth', function()
{
    // Do some nifty things in here.
}));

Can I get some +1's!?

Sent in regards to http://forums.laravel.com/viewtopic.php?pid=9966
Would like to know if people would find this useful. Cheers.

jasonlewis added some commits Jun 24, 2012
@jasonlewis jasonlewis Allow filter patterns to supply a name and callback as an easier alte…
…rnative.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
ac810f8
@jasonlewis jasonlewis Updated the documentation.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
cea48d4
@kirkbushell

+1 to this for sure, well done jason :)

@taylorotwell
The Laravel PHP Framework member

Cool idea. Would you mind making necessary updates to docs in this pull?

@jasonlewis

Its already been done mate! Check the diff. :)

@taylorotwell taylorotwell merged commit 990f10f into laravel:develop Jul 7, 2012
@taylorotwell
The Laravel PHP Framework member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment