LaravelPackages.net
Acme Inc.
Toggle sidebar
black-paradise/laravel-admin

Laravel adapter for BPAdmin — config-driven CRUD admin panel (v3)

78
2
3.0.5
About black-paradise/laravel-admin

black-paradise/laravel-admin is a Laravel package for laravel adapter for bpadmin — config-driven crud admin panel (v3). It currently has 2 GitHub stars and 78 downloads on Packagist (latest version 3.0.5). Install it with composer require black-paradise/laravel-admin. Discover more Laravel packages by black-paradise or browse all Laravel packages to compare alternatives.

Last updated

BPAdmin — Laravel Adapter (v3)

Laravel 11/12/13 adapter for BPAdmin v3. Provides Eloquent repository/mutator, CRUD controllers, service provider, and route wiring. Requires bp-admin-core (pure PHP domain layer).

Installation

composer require black-paradise/laravel-admin

Publish the config:

php artisan vendor:publish --tag=bpadmin-config

Scaffold entity definition stubs:

php artisan bpadmin:install

Configuration

All options live in config/bpadmin.php. Key keys:

| Key | Default | Description | |-----|---------|-------------| | prefix | 'admin' | URL prefix for all admin routes | | middleware | ['web'] | Middleware applied to all admin routes | | guard | 'web' | Laravel auth guard | | storage_disk | 'public' | Filesystem disk for file uploads | | per_page | 15 | Default pagination size |

Middleware & CSRF

BPAdmin routes use config('bpadmin.middleware', ['web']). The default web middleware group includes VerifyCsrfToken. If you override bpadmin.middleware, preserve VerifyCsrfToken — using only api will silently strip CSRF protection from every admin form (login, create, update, delete).

To add custom middleware while keeping CSRF, append rather than replace: config(['bpadmin.middleware' => ['web', 'auth.custom']]).

Entity Definitions

Create App\BPAdmin\{Name} classes extending EntityDefinition:

use BlackParadise\CoreAdmin\EntityDefinition;
use BlackParadise\CoreAdmin\Domain\Fields\TextField;
use BlackParadise\CoreAdmin\Domain\Fields\BooleanField;

class Users extends EntityDefinition
{
    public string $model = \App\Models\User::class;

    public function fields(): array
    {
        return [
            TextField::make('name')->required()->searchable(),
            TextField::make('email')->required(),
            BooleanField::make('is_active'),
        ];
    }
}

DashboardServiceProvider auto-discovers all EntityDefinition subclasses in app/BPAdmin/ at boot.

Production Deployment

During a production deploy, cache entity definitions alongside Laravel's own caches:

php artisan config:cache
php artisan route:cache
php artisan bpadmin:cache   # pre-builds entity manifest → bootstrap/cache/bpadmin-entities.php

Without bpadmin:cache, every request walks the filesystem to discover entity classes. This is fine locally, but in production it adds measurable overhead and triggers a boot-time log warning to remind you to run the cache command.

To clear the entity manifest (e.g. during rollback or after removing an entity):

php artisan bpadmin:cache --clear

License

MIT

Comments