Revision: Tue, 02 Nov 2021 18:17:51 GMT


Keeper contains the next bootloaders:

  • KeeperBootloader is the entrypoint for all other bootloaders
  • GuestBootloader grants full access to guest users (use it only for tests)
  • AnnotatedBootloader reads Controller and Action annotations (see Routing)
  • SitemapBootloader reads the sitemap annotations, also can be used for Sitemap definition via code (see Sitemap)
  • UIBootloader registers keeper views - layout, sidebar, breadcrumbs, grids, etc. (see Sitemap and Views)


KeeperBootloader is abstract. First of all create your own inherited bootloader. All the rest keeper bootloaders if needed should be registered in the LOAD const.



use App\Bootloader\Keeper;
use Spiral\DataGrid\Interceptor\GridInterceptor;
use Spiral\Domain\CycleInterceptor;
use Spiral\Domain\FilterInterceptor;
use Spiral\Domain\GuardInterceptor;
use Spiral\Keeper\Bootloader;
use Spiral\Keeper\Middleware;

class KeeperBootloader extends Bootloader\KeeperBootloader
    protected const NAMESPACE          = 'keeper';
    protected const PREFIX             = 'keeper/';
    protected const DEFAULT_CONTROLLER = 'dashboard';
    protected const CONFIG_NAME        = '';

    protected const LOAD = [

    protected const MIDDLEWARE = [

    protected const INTERCEPTORS = [


You can define the current keeper namespace using NAMESPACE const. keeper is by default.


You can define the current route prefix using PREFIX const. keeper/ is by default.

Default Controller

You can define the default route controller using DEFAULT_CONTROLLER const. Default action can be declared only via config file (or, if set, defaultAction annotation property or index method).

Config name

You can define the config name for the current keeper namespace using CONFIG_NAME const. If omitted, NAMESPACE const value will be used.


You can list custom middlewares in the MIDDLEWARE const. Additional middlewares can be applied in the routes separately for each route, both sets will be applied.


You can list custom interceptors in the INTERCEPTORS const.


Keeper config can be fully declared in the config file.

Config file should be stored in the app config directory.

return [
'routePrefix'   => '',
'routeDefaults' => ['controller' => '', 'action' => ''],
'loginView'     => 'keeper:login',
'middleware'    => [],
'modules'       => [],
'interceptors'  => [],

Prefix, default controller, list of middlewares, modules' bootloaders and interceptors from the constants used as config defaults.

Edit this page