yellow-three / tardis
Tardis Admin Panel Framework
Requires
- php: ^8.3
- blade-ui-kit/blade-heroicons: ^2.7
- laravel/framework: ^13.0
- livewire/livewire: ^4.0
Requires (Dev)
- larastan/larastan: ^3.15
- laravel/pint: ^1.27
- openspout/openspout: ^4.28
- orchestra/testbench: ^11.1
- pestphp/pest: ^4.7
- pestphp/pest-plugin-browser: ^4.3
- pestphp/pest-plugin-faker: ^4.0
- pestphp/pest-plugin-laravel: ^4.1
- pestphp/pest-plugin-livewire: ^4.1
Suggests
- bacon/bacon-qr-code: Draws a QR code when a user turns on two-factor authentication (^3.0).
- openspout/openspout: Adds Excel (.xlsx) export and import to BREAD lists next to CSV (^4.28).
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-01 18:50:04 UTC
README
Tardis is an admin panel for Laravel 13, built on Livewire 4 and DaisyUI 5. Point it at your Eloquent models and it generates the screens to browse, read, edit, add and delete their records (BREAD), with relation pickers, image fields, an order page and per-record actions. It adds a media library, settings, a sidebar and site menu builder, roles and permissions, user accounts, an activity log, themes and a plugin system.
If you know Voyager, Tardis covers the same ground on a current stack: BREAD definitions are versioned JSON files instead of database rows, every screen checks its permission on each request, and php artisan tardis:import:voyager brings an existing Voyager site across (migration guide).
php artisan tardis:install --email=you@example.com --demo
gives you a panel with sample content to look around in.
Requirements
- PHP 8.3+
- Laravel 13+
- Livewire 4+
- Vite + Tailwind/DaisyUI for frontend styling
Installation
1.0.0 is the first stable release. It is not on Packagist yet; install it from the GitHub repository:
composer config repositories.tardis vcs https://github.com/yellow-three/tardis composer require yellow-three/tardis:^1.0
Then let the installer migrate the database, seed the permissions, publish the compiled assets and create the first administrator:
php artisan tardis:install --email=you@example.com
tardis:install is safe to run again. The panel is then at /admin (the prefix is tardis.admin.prefix). Check the result with php artisan tardis:doctor.
To look around a filled panel first, add sample content:
php artisan tardis:install --email=you@example.com --demo # or later: php artisan tardis:demo
It adds Categories, Posts and Pages BREADs (with a category picker, an image field and an order page), a few records and a main site menu. The data lives in its own tardis_demo_* tables, so your tables are never touched, and a BREAD or menu you already have keeps its name. php artisan tardis:demo --remove takes it all away again. Outside local and testing it needs --force.
Publish the package configuration if you want to change it:
php artisan vendor:publish --tag=tardis-config
The admin stylesheet and script are served from the package itself, from a content-hash URL, so there is nothing to publish and an upgrade is picked up on the next page load. When developing the package, rebuild them with npm run build, or run npm run dev for live reloading.
Current architecture
The package follows the Livewire 4 page-first pattern:
- Static management screens are routed as Livewire pages
- Complex admin screens use the Multi-File Component (MFC) structure when they become large
- Simpler screens stay in the Single-File Component (SFC) format
- Sidebar/menu entries are derived from the MenuManager and plugin registrations
- Themes are discovered from a Vite manifest and exposed through the admin layout
This keeps the framework flexible while matching the official Livewire 4 convention:
- fixed screens like dashboard, settings, plugins, roles and permissions work as page components
- more complex screens like BREAD management and media flows can be split into MFC folders for clearer logic and template separation
Route structure
All admin routes are Livewire page routes (Route::livewire) defined in routes/admin.php, under the admin prefix (tardis.admin.prefix) and the tardis. route-name prefix:
- Fixed screens
/admin/dashboard,/admin/settings,/admin/plugins/admin/media,/admin/activity-log,/admin/search/admin/database(database explorer: list / create / edit tables)/admin/permissions,/admin/roles/admin/bread(definitions),/admin/bread/createand/admin/bread/{slug}/edit(BREAD builder)
- Dynamic BREAD resources, generated from the definitions after the fixed screens
/admin/{slug},/admin/{slug}/create,/admin/{slug}/{id},/admin/{slug}/{id}/edit
BREAD routes are generated from the BREAD definitions and constrained to the slugs that exist, so there is no catch-all: a plugin route such as /admin/blog/posts is never swallowed. Slugs reserved for built-in screens (settings, users, bread, media, …) cannot be used for a BREAD. With php artisan route:cache, rebuild the cache after creating a BREAD. Fixed screens also include /admin/users.
Authentication and authorization
Every admin route runs through the tardis.admin middleware. It delegates authentication to the enabled AuthenticationPlugin (the built-in one checks Auth::check() and redirects to /admin/login; the login form is rate limited to 5 failed attempts per email + IP) and then requires the access admin ability.
Authorization is on by default: RoleAuthorizationPlugin is registered and enabled, backed by the tardis_roles / tardis_permissions tables. A logged-in user who holds no role cannot open the panel, so create the first administrator after migrating:
php artisan migrate php artisan tardis:admin you@example.com # existing user php artisan tardis:admin you@example.com --create # create the user as well (password generated, or --password=...)
tardis:admin creates the super-admin role, provisions every permission and assigns the role; it is safe to run again. Roles listed in tardis.authorization.super_admin_roles (default super-admin) bypass every check. Further roles and their permissions are managed on the Roles and Permissions pages, and roles are assigned to people on the Users page.
The Users page also creates accounts, edits their name, email and password, and deletes them. A user manager cannot edit or delete a super administrator, or anyone holding a permission they do not hold themselves, and cannot delete their own account or the last super administrator. Everyone edits their own name, email and password on Profile; changing the email or the password asks for the current password. Both work on the model of the default auth provider; set tardis.users.columns when its name, email or password columns are called something else (a missing column is left out).
What is checked where:
| Screen | Ability |
|---|---|
| BREAD resources | browse / read / add / edit / delete + the resource slug (browse posts); provisioned automatically when a BREAD definition is saved |
| Settings, Plugins, Users, Roles + Permissions, Database Explorer, BREAD management + builder, Activity log | manage settings, manage plugins, manage users, manage roles, manage database, manage bread, view activity |
| Media | browse media, plus upload media, rename media, delete media for writes |
| System diagnostics, log viewer, command runner | view system, view logs, run commands — one ability per screen, so holding one never grants or hides another |
Pages check their ability on every Livewire request, not only on mount, and the sidebar hides entries the user may not open. If the host user model already has a hasPermissionTo() method (for example Spatie's HasRoles), that answer is used instead of the Tardis tables.
To use your own authorization, set tardis.authorization.enabled to false and register an AuthorizationPlugin. With no authorization plugin at all, every authenticated user is allowed into the panel, so only disable it if something else protects /admin.
Menu system
The sidebar is built from the MenuManager and plugin-provided items.
use Tardis\Facades\Tardis; $menu = Tardis::menu();
Default entries include:
- Overview: Dashboard, Media, UI Components
- Management: Settings, Plugins, Database Explorer, System (diagnostics, logs, commands), BREAD (plus one entry per BREAD resource)
- Access: Permissions, Users, Roles
Entries the current user is not allowed to open are hidden. The user dropdown offers the panel's Profile page (/admin/profile) and Logout.
Menu items can be grouped by section and can participate in active-route detection across nested admin pages.
Menus and settings on your own site
Menus → Site menus (/admin/menus/site) holds named menus for your own pages, such as main or footer. Each item has a title, a URL (http(s), root-relative such as /blog, or #fragment) and may open in a new tab. Items nest up to three levels. Show a menu with the Blade component:
<x-tardis::site-menu name="main" class="menu menu-horizontal" />
or read it as a tree and render it yourself:
foreach (menu('main') as $item) { // $item['title'], $item['url'], $item['new_tab'], $item['children'] } setting('admin.title', 'My site'); // a panel setting by "group.key"
tardis_menu() and tardis_setting() always exist. The short menu() and setting() names are added only when your application has no function of that name already.
Moving from Voyager
php artisan tardis:import:voyager reads a Voyager 1.x database and writes what Tardis can use:
- BREAD from
data_types/data_rows: field types, browse/read/edit/add flags, validation, options and defaults, image resize and thumbnails,belongsTo/hasOne/hasMany/belongsToManyrelationships, order column and search key. Voyager's ownusers,menus,rolesandsettingstypes are skipped: built-in Tardis screens handle them. - Menus other than
admin(the panel builds its own sidebar) become site menus. Items with a route are kept when that route exists in your application. - Settings, keyed
group.keyas in Voyager. - Roles with their permissions mapped onto Tardis abilities (
browse_posts→browse posts,browse_admin→access admin,edit_settings→manage settings), and users' roles fromuser_rolesandusers.role_id.
Point --connection at the Voyager database if it is not the default one, and start with --dry-run. The report lists everything that was imported or skipped, and every field, permission or menu item that has no Tardis equivalent (for example multiple_images). Existing BREADs, menus and settings are left alone unless you pass --force. Voyager does not record the method name of a hasOne, hasMany or belongsToMany relation; the import guesses it (categories) and the report asks you to check it.
Theme system
Themes are data. The built-in tardis-light and tardis-dark ship in the compiled stylesheet; any other theme is a validated entry in storage/tardis/themes.json that Tardis turns into a [data-theme] rule at request time, so a host can add one without rebuilding any assets.
- The server resolves the theme per request (the user's own choice, else the defaults under Settings → appearance, else the built-ins) and writes
data-themeon<html>, so the first paint is already right. - Users pick a mode (light, dark, follow the system) and a light and a dark theme from Settings; administrators can create and edit custom themes under Themes (
manage appearance). - A custom theme can also be added in code with
app(\Tardis\Theme\ThemeManager::class)->saveCustom([...]): aname([a-z0-9-]), ascheme(lightordark) and colours (at leastprimary,base-100andbase-content; values are checked against an allow-list of colour formats). - Extra CSS goes in Settings → appearance → custom CSS, or in a stylesheet registered with
Tardis::addCss().
BREAD usage
A BREAD definition is a JSON file under storage/tardis/bread/{slug}.json (configurable through tardis.bread.path, defaults to storage_path('tardis/bread')). The management screens then render list/detail/edit/create screens from that metadata instead of hardcoding one-off admin pages.
The fastest way to create one is from an existing model:
php artisan tardis:make:bread "App\Models\Post"
This writes storage/tardis/bread/posts.json with the fields detected from the model (fillable + schema nullability):
{
"slug": "posts",
"model": "App\\Models\\Post",
"name": "Post",
"name_plural": "Posts",
"fields": []
}
Definitions are read through the BreadManager:
use Tardis\Bread\BreadManager; app(BreadManager::class)->find('posts'); // ?BreadDefinition app(BreadManager::class)->all(); // Collection of BreadDefinition
Every save keeps a timestamped backup (posts.backup.{Y-m-d@H-i-s.u}.json) and prunes older ones to tardis.bread.backup_keep (default 10). Backups can be restored from the BREAD management screen.
Legacy PHP definitions in config/bread/{slug}.php are still readable. Migrate them to JSON storage with:
php artisan tardis:bread:import-legacy # write JSON copies php artisan tardis:bread:import-legacy --dry-run # preview what would be migrated php artisan tardis:bread:import-legacy --force # overwrite existing JSON with the same slug php artisan tardis:bread:import-legacy --delete # move migrated .php files to config/bread-migrated
Export all JSON definitions as a single document with:
php artisan tardis:bread:export --file=bread-export.json
php artisan tardis:bread:export # print to stdout
Livewire usage
Livewire is used for the admin shell and fixed page screens, for example:
<livewire:tardis::pages.dashboard /> <livewire:tardis::pages.settings /> <livewire:tardis::pages.bread.manage />
Larger screens (BREAD pages, BREAD builder, media browser, database explorer, settings) are Multi-File Components; small ones stay Single-File Components. Class-based components are not used. See docs/LIVEWIRE_PAGE_ORGANIZATION.md.
Artisan commands
| Command | Purpose |
|---|---|
tardis:admin {email} |
Make a user a super administrator (--create creates the user) |
tardis:make:bread {model} {slug?} |
Create a BREAD definition (JSON) from an Eloquent model |
tardis:make:model {table} |
Generate an Eloquent model for an existing table |
tardis:make:plugin {name} |
Scaffold a plugin package (--with-menu, --with-widgets, --with-settings, --with-migration, --with-model) |
tardis:bread:import-legacy |
Convert legacy config/bread/*.php definitions to JSON |
tardis:demo |
Add sample categories, posts, pages and a site menu (--remove takes them away) |
tardis:import:voyager |
Import BREADs, menus, settings and roles from a Voyager 1.x database (--connection, --only=bread, --dry-run, --force) |
tardis:bread:export |
Export all JSON definitions as one document |
tardis:doctor |
Report install health; exits non-zero on failure so it can gate a deploy (--json for scripts) |
tardis:activity:prune |
Remove activity log entries older than tardis.activity_log.retention_days (--days, --pretend); schedule it daily |
tardis:state:copy |
Copy settings, menus, themes, plugin switches and BREAD definitions between the file and database state drivers (--to=database|file, --force) |
tardis:install |
Idempotent installer: migrate, seed permissions, publish assets, optionally create the first admin (--email, --force) |
See docs/PLUGIN_GUIDE.md and docs/EXAMPLE_BREAD.md.
Export and import
Every BREAD list exports what it shows (columns, search, filters, sort) as CSV, and imports a CSV through the same validation and abilities as the forms. Install openspout/openspout (composer require openspout/openspout) and an Export Excel button appears next to it; .xlsx files are then accepted by the import too (first sheet, same header rules). Without the package only CSV is offered; tardis.bread.xlsx = false hides Excel even when it is installed.
List views, inline editing and duplicates
- Saved views: the Views menu on a BREAD list saves the current search, sort, page size, filters and deleted-records mode under a name, per user (up to 20 per list), and brings them back with one click. They are kept with the user's preferences (
tardis.state.driver). - Inline editing: a field with
"inline": true(text, number, email or url types) is edited right in the list cell: click, change, Enter. The field's own validation and the record's edit ability apply; Esc cancels. - Duplicate: every BREAD has a Duplicate action (needs the add ability) that opens the create form filled with a copy of the record; files, passwords and has-one/has-many relations are left empty, and nothing is saved until the form is submitted.
Command palette, notifications and charts
- Command palette: Ctrl+K (⌘K) on any panel page, or the button in the header, opens a list of every sidebar page the user may open plus "New …" for each BREAD they may add to; type to filter, arrows and Enter to go. Anything else searches the records.
window.Tardis.palette()opens it from your own script. - Notifications: the bell shows the signed-in user's latest messages, with an unread count, and checks again every minute. Send one with
Tardis::notify($user, 'Import finished', 'Body', url: '/admin/posts', level: 'success')(a user, an id, or a list), or from a Laravel notification whosevia()returns['tardis']and that hastoTardis($notifiable)returningtitle,body,url,level. Messages live intardis_notifications. - Chart widgets: extend
Tardis\Dashboard\ChartWidget, returntype()(line,bar,doughnut),labels()anddatasets()([['label' => …, 'data' => [...]]]), and add it like any widget from a plugin'sprovideWidgets(). It is drawn as an accessible SVG in the theme's colours, with no JavaScript chart library. The dashboard ships an "Activity, last 14 days" chart.
Languages
The panel speaks English, Turkish, German, French, Spanish and Arabic. Arabic (and any fa, he, ur translation you add under lang/vendor/tardis) is written right to left: the layouts set dir="rtl" and the views use logical spacing (ms-, pe-, text-start).
Extra CSS and JavaScript
tardis.assets.css and tardis.assets.js take lists of URLs (https://… or root-relative /…) that load on every admin page after the package assets. Plugins can add inline CSS/JS through the CSS / JS provider contracts.
JSON API
Set TARDIS_API=true and every BREAD is also a JSON API under /api/tardis (tardis.api.prefix):
| Request | Ability | Answer |
|---|---|---|
GET /api/tardis |
— | The BREADs you may browse, with their fields (name, type, label, validation, read/add/edit) |
GET /api/tardis/{slug} |
browse | data, meta (page, total), links; search, sort, direction, per_page (≤ max_per_page), filter[], trashed |
GET /api/tardis/{slug}/{id} |
read | One record |
POST /api/tardis/{slug} |
add | 201 with the record, or 422 with errors per field |
PUT / PATCH /api/tardis/{slug}/{id} |
edit | PUT sends every field, PATCH only those that change |
DELETE /api/tardis/{slug}/{id} |
delete | 204 |
It is the panel's definition, not a second one: the same validation rules, scope, owner_column (someone else's record is a 404; a new record belongs to the caller), field ability (a field you may not see is neither returned nor written), read/add/edit switches, events and activity log. Passwords and the model's $hidden attributes are never returned; uploads are not taken over JSON. The caller needs "access admin" like any panel user. tardis.api.middleware decides how a client signs in (default ['api', 'auth:sanctum', 'throttle:60,1'], which needs laravel/sanctum); tardis.api.only limits the API to some slugs.
Where the panel keeps its state
Settings, themes, the admin menu overlay, site menus, the dashboard layout, plugin switches, user preferences and BREAD definitions are runtime data. By default (tardis.state.driver = file) they are JSON files under storage/tardis, written atomically and under a lock. On several servers, or in containers whose storage is thrown away on deploy, set TARDIS_STATE_DRIVER=database: the same entries are then rows of tardis_state (created by php artisan migrate), shared by every server and read once per request. Move what you have with php artisan tardis:state:copy --to=database (--to=file goes back; --force overwrites). tardis:doctor reports the driver.
To ship BREAD definitions with the code instead, keep the file driver and point tardis.bread.path at a directory in the repository.
Database Explorer
The explorer never lists, opens, alters or drops framework tables (migrations, sessions, jobs, cache, …, configurable in tardis.database.hidden_tables) or this package's tardis_* tables.
Every change made there (create or drop a table, add, rename, change or drop a column) is written as a migration under database/migrations (tardis.database.migrations.path) and run at once, so it is in the migrations table and, once you commit the file, reaches the other environments with php artisan migrate. The generated down() reverses it where it can (a dropped table cannot be restored). TARDIS_DATABASE_MIGRATIONS=write only writes the files; off alters the schema directly as before. Schema changes stay limited to tardis.database.schema_changes.environments (local and testing by default).
System diagnostics
Three read-mostly screens, each behind its own ability (view system, view logs, run commands). They appear as three separate sidebar entries rather than one collapsible group, so holding one ability never hides or strands a sibling.
- Diagnostics runs the same checks as
tardis:doctor: PHP version, Laravel version, storage permissions, database tables, published assets, route cache, the authorization plugin, the themes file, installed plugins and BREAD definitions. - Log viewer tails files under
tardis.system.logs.path(defaultstorage/logs).filename_patternrestricts which names may be opened, andmax_bytescaps a single read — the reader seeks to the end, so a large log costs a seek rather than a full load. - Command runner is off by default. Even enabled, it stays closed unless the app runs in one of
tardis.system.commands.environments(defaultlocal) and the command appears intardis.system.commands.allowlistas['name' => [...allowed args]]. An empty allowlist allows nothing, so enabling the runner is never by itself enough to expose artisan to a browser.
php artisan tardis:doctor --json reports the same checks as JSON and exits non-zero when a check fails, so it can gate a deploy.
Media uploads
Uploads on the media screen are limited to the extensions in tardis.media.allowed_mimes (images, pdf, office documents, zip) and to tardis.media.max_file_size KB. Executable or markup files such as .php and .html are rejected. Publish the config with --tag=tardis-config to change the list; svg is left out of the default list. When you add it, every SVG upload (media screen and file, image and media fields) is cleaned first: scripts, event handlers, javascript:/data: links, embedded HTML, DOCTYPEs and entities are removed, and a file that cannot be read safely is refused.
The file details show where a file is used (BREAD records whose image, file, media or rich text fields hold its path, and settings), and deleting a file that is still used warns first.
Files reach the media screen through Livewire's temporary upload, which applies its own limits first: 12 MB per file and 60 uploads a minute by default. To accept files larger than 12 MB, raise both tardis.media.max_file_size and Livewire's rule in config/livewire.php:
'temporary_file_upload' => [ 'rules' => ['required', 'file', 'max:51200'], // KB ],
PHP's upload_max_filesize and post_max_size must allow the size too.
Image uploads get a thumbnail for the media grid, fitted inside tardis.media.thumbnail_size (300×300 by default) at tardis.media.thumbnail_quality. Thumbnails are stored under .tardis-thumbnails/ on the media disk, outside the browsable folder, and are removed with their file. This needs PHP's GD extension; without it the grid shows the original images.
Testing
The package includes feature tests for the core admin flows and BREAD behavior.
composer test
composer test-coverage
composer lint
composer lint-fix
Development workflow
Use the project scripts defined in composer.json as the default workflow for validation and formatting:
composer test
composer lint
For local coverage or formatting fixes:
composer test-coverage composer lint-fix
Extending
- Field types:
Tardis::formfields()->registerType('my_type', MyField::class)makesmy_typevalid in BREAD definitions. (Custom rendering in the create/edit pages arrives with phase 2.) - Assets:
Tardis::addCss('/vendor/host/extra.css'),Tardis::addJs(Asset::js('https://…', integrity: 'sha384-…'))orAsset::inlineCss(...). URLs must be http(s) or root-relative. - Events: listen to
BreadSaved,BreadRemoved,BreadRecordCreated,BreadRecordUpdated,BreadRecordDeletedand thetardis.pageevent. Permissions and the activity log are listeners you can replace. - Authentication: register an
AuthenticationPluginafter the built-in one; the login form and the middleware use the last registered, throughattempt(). - Policies: extend
Tardis\Policies\BasePolicy— it asks the same authorization plugin the BREAD pages do. - Per-BREAD overrides: a definition may set
components(replace a page's Livewire component),policy(ability word) andscope(model scope for listings and lookups). Slugs such assettings,usersorbreadare reserved.
See UPGRADE.md when coming from a development build.
Documentation
| File | What it covers |
|---|---|
| UPGRADE.md | Every change to make when upgrading |
| PROJECT_STATUS.md | Architecture summary |
| RELEASE_NOTES.md | What the package includes and what changed |
| docs/PLUGIN_GUIDE.md | Writing and enabling plugins |
| docs/EXAMPLE_BREAD.md | A complete BREAD definition and every field option |
| docs/CUSTOMIZATION.md | Actions, custom field types, accessors, replacing screens and views, panel routes, another guard, soft deletes |
| docs/MIGRATING_FROM_VOYAGER.md | Importing a Voyager site and replacing Voyager calls |
| docs/DEMO_FLOW.md | A walkthrough for demonstrating the panel |
| docs/constraints.md | Permanent constraints and gotchas |
| docs/notes.md, docs/backlog.md | Open findings and the roadmap |
Security
Report security problems privately, as described in SECURITY.md.
License
MIT, see LICENSE. Contributions: CONTRIBUTING.md; changes per version: CHANGELOG.md.