Welcome Guest, Not a member yet? Register   Sign In
Multiple Filters not working when added to a single alias
#1

I have two filters that I would like to apply to a single route.  ValidUser checks to see if the user exists in the database.  CurrentUser checks to see if the the user is currently logged in.  I created both filters and corresponding aliases in App\Filters, and they work when applied to the routes in question individually.  I also created another alias containing both filters in App\Filters:

PHP Code:
'check_user' => [
    \
App\Filters\ValidUser::class,
    \
App\Filters\CurrentUser::class,


However, when 'check_user' is applied to a route, neither filter works.

PHP Code:
$routes->get('remove/(:num)''Admin\Users::delete/$1', ['filter' => 'check_user:users']); 

What am I doing wrong?
Reply
#2

I figured it out. My controller name was the same as one of my route paths, and that was messing things up with auto-routing enabled. I've change the route path and all is well.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB