Route
Less than 1 minute
Route
interface RouteMethods
middleware
Attach middleware to the route.
public middleware(Middleware|string $middleware, mixed $args): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$middleware | Hazaar\Middleware\Interface\Middleware | string |
$args | mixed |
auth
Attach an authentication adapter to the route.
public auth(?Adapter $adapter, mixed $args): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$adapter | Hazaar\Auth\Adapter | |
$args | mixed |
role
Require ANY of the roles.
public role(string $role, string $roles): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$role | string | |
$roles | string |
can
Require ALL of the permissions.
public can(string $permission, string $permissions): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$permission | string | |
$permissions | string |
authorize
Require a custom check to pass.
public authorize(\Closure $check): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$check | Closure |
secure
Apply a declarative security setting (roles, or roles and permissions).
public secure(array|string $security): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$security | array | string |
Generated by Hazaar API Doc Generator on Sun, 08 Nov 2026 03:36:15 +0000