Hi guys,
I have a filter for
'account/*', but it is too general and will also match '
api/account'. I wish to exclude any uri with
api from matching.
I tried to do the following code in Config/Filters.php, but it didn't work as I would have expected. Is there a simple way that I'm missing?
Code:
/**
* List of filter aliases that are always
* applied before and after every request.
*
* @var array
*/
public $globals = [
'before' => [
'isLoggedIn' => ['except' => 'api/*'],
],
'after' => [
'toolbar',
],
];
/**
* List of filter aliases that should run on any
* before or after URI patterns.
*
* Example:
* 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
*
* @var array
*/
public $filters = [
'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
];