admin-project/admin-bundle
Admin bundle for Laravel projects, providing a ready-to-use admin foundation with common utilities and configuration to speed up building back-office features. Install, configure, and extend it to fit your app’s admin workflows and UI needs.
Installation
composer require admin-project/admin-bundle
Publish the bundle’s assets and config:
php artisan vendor:publish --provider="AdminProject\AdminBundle\AdminBundleServiceProvider" --tag="config"
php artisan vendor:publish --provider="AdminProject\AdminBundle\AdminBundleServiceProvider" --tag="public"
Basic Setup
config/app.php under providers:
AdminProject\AdminBundle\AdminBundleServiceProvider::class,
php artisan migrate
First Use Case: CRUD Interface
User) and generate a controller:
php artisan make:admin User
routes/admin.php (auto-generated by the bundle).Model Integration
AdminController or use traits like AdminTrait for quick CRUD scaffolding.use AdminProject\AdminBundle\Traits\AdminTrait;
class UserAdminController extends AdminController
{
use AdminTrait;
protected $model = \App\Models\User::class;
}
Customization via Configuration
config/admin.php:
'columns' => [
'id' => 'ID',
'name' => 'Name',
'email' => 'Email',
],
'filters' => ['name', 'email'],
Field-Specific Logic
AdminField classes to customize form inputs, validation, or display:
protected function configureFields()
{
return [
'name' => new TextField(),
'email' => new EmailField(),
'active' => new BooleanField(),
];
}
API Integration
Route::apiResource('admin/users', UserAdminController::class);
Middleware & Authentication
auth:admin):
Route::middleware(['auth:admin'])->group(function () {
require __DIR__.'/admin.php';
});
Route Conflicts
routes/admin.php doesn’t clash with frontend routes. Use namespace prefixes:
Route::prefix('admin')->group(function () {
Route::resource('users', UserAdminController::class);
});
Model Binding Issues
fillable/guarded attributes match the fields exposed in the admin panel to avoid mass-assignment errors.Asset Loading
public/vendor/admin-bundle/ and clear cached views:
php artisan view:clear
Database Migrations
Extend the Bundle
resources/views/vendor/admin-bundle/ for theming.Debugging
config/admin.php to log queries or errors:
'debug' => env('APP_DEBUG', false),
Performance
protected $with = ['posts']; // For a User model with posts relationship
Localization
php artisan vendor:publish --tag=admin-lang
Testing
$this->actingAs($adminUser)
->get('/admin/users')
->assertStatus(200);
How can I help you explore Laravel packages today?