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.
- ⚡ 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.
Install the package via Composer:
composer require x-multibyte/blat-adminRun the interactive install command:
php artisan blat-admin:installThis command will:
- Publish configuration, assets, views, and migrations.
- Run database migrations.
- Prompt to create your initial Super Administrator account.
If you prefer compiling assets with your own Vite and Tailwind CSS pipeline:
php artisan blat-admin:install --viteDefine 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(),
],
],
];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'),
]);
});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']);
});composer testBlat Admin is open-sourced software licensed under the MIT license.