x-multibyte / blat-admin
Build an Admin Panel for Laravel projects with BlatUI.
Requires
- php: ^8.3
- illuminate/auth: ^12.0||^13.0
- illuminate/console: ^12.0||^13.0
- illuminate/contracts: ^12.0||^13.0
- illuminate/database: ^12.0||^13.0
- illuminate/http: ^12.0||^13.0
- illuminate/routing: ^12.0||^13.0
- illuminate/session: ^12.0||^13.0
- illuminate/support: ^12.0||^13.0
- illuminate/validation: ^12.0||^13.0
- illuminate/view: ^12.0||^13.0
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.6||^5.0
- pestphp/pest-plugin-laravel: ^4.1||^5.0
- pestphp/pest-plugin-type-coverage: ^4.0||^5.0
- phpstan/extension-installer: ^1.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-12 14:43:39 UTC
README
Blat Admin
x-multibyte/blat-admin is a JSON Schema-driven admin panel package for Laravel, powered by BlatUI. Build administrative interfaces with declarative schemas for forms, tables, and charts without generating boilerplate controllers, views, or routes.
Features
- ⚡ JSON Schema-Driven: Define forms, data tables, and charts declaratively.
- 🎨 BlatUI & Tailwind Ready: Modern UI components with prebuilt zero-build assets or Vite theming support.
- 🔐 Dedicated Authentication: Isolated
Adminmodel, session guard (blat-admin), and provider. - 🔄 Hybrid View Support: Seamlessly fallback to custom Blade views when schema is not enough.
Installation
Install the package via Composer:
composer require x-multibyte/blat-admin
Run the interactive install command:
php artisan blat-admin:install
This command will:
- Publish configuration, assets, views, and migrations.
- Run database migrations.
- Prompt to create your initial Super Administrator account.
Custom Vite Mode
If you prefer compiling assets with your own Vite and Tailwind CSS pipeline:
php artisan blat-admin:install --vite
Quick Start
1. Register Schema Pages in Config
Define declarative pages in config/blat-admin.php:
use XMultibyte\BlatAdmin\Schemas\TableSchema; use XMultibyte\BlatAdmin\Schemas\Columns\TableColumn; use XMultibyte\BlatAdmin\Schemas\Actions\Action; return [ 'path' => 'admin', 'pages' => [ 'users' => [ 'title' => 'User Management', 'schema' => TableSchema::make('User Management') ->model(\App\Models\User::class) ->columns([ TableColumn::make('id', 'ID')->sortable(), TableColumn::make('name', 'Name')->searchable(), TableColumn::make('email', 'Email'), TableColumn::make('role', 'Role')->badge(), ]) ->actions([ Action::make('edit', 'Edit')->url('/admin/users/{id}/edit'), ]) ->paginate(20) ->toArray(), ], ], ];
2. Register Pages Dynamically with BlatAdmin Facade
You can also register pages at runtime inside a Service Provider:
use XMultibyte\BlatAdmin\Facades\BlatAdmin; use XMultibyte\BlatAdmin\Schemas\FormSchema; use XMultibyte\BlatAdmin\Schemas\Fields\FormField; BlatAdmin::registerPage('settings', function () { return FormSchema::make('System Settings') ->action(route('admin.settings.store')) ->fields([ FormField::make('site_name', 'Site Name')->required(), FormField::make('maintenance_mode', 'Maintenance Mode')->type('switch'), ]); });
3. Chart Schemas
use XMultibyte\BlatAdmin\Schemas\ChartSchema; BlatAdmin::registerPage('analytics', function () { return ChartSchema::make('Monthly Revenue') ->type('area') ->series([ ['name' => 'Revenue ($)', 'data' => [120, 200, 150, 300, 250, 400]], ]) ->categories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']); });
Testing
composer test
Credits
License
Blat Admin is open-sourced software licensed under the MIT license.