Pages

Each page contain a set of properties.

There is required 'default' property, which describes what should see user when visiting this page.
And there can be properties for GET, POST, PUT, PATCH and DELETE methods, which can contain multiple actions.

Pages are stored in /config/hush/pages.

You can create new page by php artisan hush:page {page_name} command. More about commands you can read in Artisan commands section.

Url builds based on page path. For example page users/index.php will have url /admin/users, page users/edit.php will have - /admin/users/edit etc.
NOTE: Instead of /admin/ may be custom prefix, specified in config/hush/app.php.

Let's see the 'default' property in default users/index.php file.

'default' => [
    'class' => null,
    'title' => 'users',
    'breadcrumbs' => ['users' => null],
    'permission' => 'admin:users',

    'blocks' => [
        // blocks specification
    ]
]

It may contain:

  • 'class' - which serve for page class specification and may admit you to modify styles for current page or run some custom js.
  • 'title' - which serve to customize page title. May contain key of the translation or closure.
  • 'breadcrumbs' - which serve to customize breadcrumbs, currently it produce Home -> Users. More about breadcrumbs you can read in Linking section
  • 'permission' - permission that is required to enter this page
  • 'blocks' - contains blocks description. Blocks is a build material for pages in hush. More about blocks you can find in Blocks section
  • 'closure' - function which must be executed before page loads, all what will be returned by this function will be available to use in another closures on that page. Example of using that function you can find in users/edit.php page.