CodeIgniter Forums
Problem with filters - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Problem with filters (/showthread.php?tid=88484)



Problem with filters - motoroller - 09-14-2023

Hello everyone, i use few filters in project, one global and one in some routers

In Config/Filters i have global
PHP Code:
public array $globals = [

        'before' => [

            'isLoggedIn' => [

                'except' => [
                    'admin*'
]

]

]; 

public bool $multipleFilters = true;

When i load this: $routes->get('/', [Start::class, 'Index'], [ 'filter' => 'isBlocked' ]);  router my local "isBlocked" filter is working, but my global filter "isLoggedIn" is not execute why? Before is working properly but after update is not(

Then i have added to Filters

PHP Code:
public array $filters = [
        'isBlocked' => ['before' => ['start']]
    ]; 
but filters "isBlocked" is not working as well(


RE: Problem with filters - sammyskills - 09-14-2023

Check the filters using your terminal:

Code:
php spark filter:check get /

See https://codeigniter4.github.io/CodeIgniter4/incoming/filters.html#confirming-filters