Download the PHP package rafalmasiarek/dashboard-kit without Composer

On this page you can find all versions of the php package rafalmasiarek/dashboard-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dashboard-kit

dashboard-kit

Slim 4 dashboard framework. Provides module auto-discovery, dynamic navbar, session-based auth (via AuthKit), CSRF protection, Twig templating, structured logging, mail, and a plugin extension system.

Requirements

Installation

Quick start

Module structure

Each module is a directory containing module.php:

Modules appear in the navbar automatically. Admin modules (under admin_modules_path) appear in the /admin panel.

Database schema

Declare tables directly in module.php under the schema key. On every boot the framework compares a hash of each table's definition against the stored hash — unchanged tables are skipped entirely. Changed or new tables are created (CREATE TABLE IF NOT EXISTS) and any new columns are added (ALTER TABLE ADD COLUMN). Columns are never dropped.

Every managed table automatically gets id (UUID CHAR(36)) and created_at (DATETIME, DEFAULT CURRENT_TIMESTAMP). Supported column types: string, text, int/integer, bigint, tinyint, bool/boolean, decimal, float, datetime, date, json, uuid.

Tables outside modules

Tables that do not belong to any module can be declared at the top level of the config under schema:

Table prefix

Add table_prefix to the config to namespace all managed tables. System tables (_schema_state, _table_version, _query_cache) are never prefixed.

In handlers that build raw SQL, use CachingPdo::table() to apply the prefix consistently:

The prefix is also available as db.table_prefix in the container.

Seed data

Declare default rows under the seed key (top-level config or per-module). Each seed table is paired with a match column for the existence check — rows are inserted only when no matching record exists, making seeds idempotent on every boot.

created_at is never injected — the database fills it in via DEFAULT CURRENT_TIMESTAMP.

Query cache

All SELECT queries issued through PDO::class from the container are transparently cached — no code changes required in handlers. The cache is version-keyed: any write to a table automatically makes all cached SELECT results for that table unreachable without explicit invalidation.

Cache behaviour by statement type:

Type Behaviour
SELECT Checks cache before executing; stores fetchAll() result on miss
INSERT / UPDATE / DELETE / REPLACE Executes normally; bumps version counter for affected tables
System tables (_query_cache, _table_version, _schema_state) Always bypass cache

Only fetchAll() results are cached. fetch() and fetchColumn() always hit the database.

Default TTL is 300 seconds. The cache is stored in the _query_cache table and never goes stale: a write to table T makes all cached SELECT keys that referenced T unreachable — they can never be served after the write.

Plugin extension points

Plugins can extend the UI without modifying core templates:

Settings sections

Register a section card on the /settings page:

User action buttons

Register a button in Admin → Users per-user row:

Form slots

Inject HTML into the login or register forms without modifying core templates. Resolve FormSlotRegistry from the container and call register() before run().

Built-in slots:

Form Slot Position
login form_fields Inside <form>, before the submit button
login scripts In {% block scripts %}, outside the form
register form_fields Inside <form>, before the submit button
register scripts At the end of {% block scripts %}

In Twig, slots are rendered via {{ form_slot('login', 'form_fields') }} — already present in the core templates, no template changes needed.

See docs/form-slots.md for the full reference including the PHP-DI callable pitfall.

Auth failure hooks

Emitted after failed credential checks, useful for rate limiting and abuse detection:

Error handling

SafeErrorHandler handles all Slim errors with content negotiation:

Logging

Named Monolog channels in key=value format, registered as logger.{name} in the container:

Audit events use dot-notation names: dashboard.login, dashboard.register, dashboard.role_changed, etc.

Redirect after login

When AuthMiddleware blocks an unauthenticated request it redirects to /login?from=<encoded-path>. After successful login the controller redirects back to that path instead of the default /.

Only same-origin paths are accepted (from must start with / and not with //) to prevent open redirect attacks.

Logged-in users visiting /login or /register are redirected immediately to / — these routes are guest-only.

Built-in routes

Route Description
GET / Home page — auth-aware, renders home.twig
GET/POST /login Login
GET /logout Logout
GET/POST /register Registration
GET /settings User settings
GET /admin Admin panel
GET /admin/users User management

Home page

GET / renders the built-in home.twig. The template checks auth.isLoggedIn() and shows different content for guests and authenticated users.

To customise, place home.twig in your application's templates/ directory — it takes precedence over the built-in:

Available Twig globals on this page: auth, app_name, modules, registration_enabled, flash.

Templating and layout customisation

layout.twig is split into named blocks that can be overridden independently:

Block Default Use
{% block head %} empty Extra <link> / <meta> tags
{% block navbar %} Bootstrap navbar Replace or remove the navbar
{% block header %} empty Hero/banner below navbar
{% block content %} empty Main page body
{% block footer %} empty Site-wide footer
{% block scripts %} empty Extra scripts before </body>

To override a single block without replacing the whole layout, extend @dashboard-kit/layout.twig (the namespace avoids infinite recursion when your file is also called layout.twig):

See docs/templating.md for the full reference.

License

MIT License — see LICENSE.


All versions of dashboard-kit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/clock Version ^1.0
psr/container Version ^1.1 || ^2.0
psr/log Version ^3.0
slim/slim Version ^4.12
slim/psr7 Version ^1.5
slim/twig-view Version ^3.3
php-di/php-di Version ^6.4 || ^7.0
rafalmasiarek/authkit Version ^2.1.2
rafalmasiarek/csrf-token Version ^1.6
rafalmasiarek/real-ip-resolver Version ^2.3
rafalmasiarek/dns-resolver Version ^0.2.0
rafalmasiarek/http-client Version ^3.0
rafalmasiarek/mailer Version ^0.3.0
filp/whoops Version ^2.15
monolog/monolog Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rafalmasiarek/dashboard-kit contains the following files

Loading the files please wait ...