📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials CodeIgniter 4 CI4 Filter Chains

CI4 Filter Chains

5 min read
Chain multiple filters on routes (auth,admin) and apply global CORS and rate-limiting filters.

Filter Chains

// Apply multiple filters to a route
$routes->get("/admin/posts", "Admin\Posts::index", [
    "filter" => "auth,admin"
]);

// Filter group
$routes->group("api", ["filter"=>"jwt,throttle"], function($r) {
    $r->resource("posts");
    $r->resource("users");
});