laravel - Custom Filter Class - more than one filter in class -
i've read number of tutorials on custom filters.
here how custom filter set up:
class mycustomfilter { public function filter($route, $request) { } public function filter2($route, $request) { } } in filters file have:
route::filter('my_filter', 'mycustomfilter'); is there way have more 1 filter in class? i've tried calling so:
route::filter('my_filter', 'mycustomfilter.filter2'); but no luck.
you should able achieve using class@method
route::filter('my_filter', 'mycustomfilter@filter'); route::filter('my_filter', 'mycustomfilter@filter2');
Comments
Post a Comment