Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 2 years ago.
0

Not sure, but can you really separate a list of methods with a pipe like this? I know that you can do this with a list of filters when creating a route, but did you try to put your methods in an array like so?

$this->beforeFilter('admin_check', array('only' =>
                            array('getIndex', 'getString', 'postString'...)));
Last updated 2 years ago.
0

Your best bet are the API docs. Looking at the docs you can see that the beforeFilter call is instantiating a Before object. Following the rabbit trail all the way down you can see that the before object does indeed accept an array of items for only and except as DavidDomain suggests (look at the definition of the only var).

Last updated 2 years ago.
0

Thank you darryl, your answer is much more helpful than my suggestion. ;-)

Last updated 2 years ago.
0

Tanks guys. Nice, API docs is what I indeed need. Your answers are very helpful.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

abnemo abnemo Joined 12 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.