kachnitel / admin-bundle
Modern Symfony admin bundle powered by LiveComponents for Doctrine entities with extensive customization
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 3
Type:symfony-bundle
pkg:composer/kachnitel/admin-bundle
Requires
- php: >=8.2
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.0|^3.0
- symfony/form: ^6.4|^7.0
- symfony/framework-bundle: ^6.4|^7.0
- symfony/security-bundle: ^6.4|^7.0
- symfony/serializer: ^6.4|^7.0
- symfony/twig-bundle: ^6.4|^7.0
- symfony/ux-live-component: ^2.0
- symfony/ux-twig-component: ^2.0
- twig/twig: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.51
- marcocesarato/php-conventional-changelog: ^1.17
- phpmd/phpmd: ^2.12
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.0|^11.0
- symfony/browser-kit: ^6.4|^7.0
- symfony/console: ^7.4
- symfony/css-selector: ^6.4|^7.0
- symfony/stimulus-bundle: ^2.31
- symfony/var-exporter: ^7.0
- symfony/webpack-encore-bundle: ^2.4
- symfony/yaml: ^8.0
Suggests
- frd/entity-components-bundle: For attachment, tag, and comment features
README
Modern Symfony admin bundle for managing entities
- Powered by Symfony's LiveComponents
- Minimal config
- Extensive customization capabilities
- Requires no front end libraries beyond Live Components
Documentation
- Configuration Guide - Configure entities with the
#[Admin]attribute - Column Filtering - Automatic per-column filters and customization
- Batch Actions Setup - Enable multi-select and bulk operations
- Asset Management - AssetMapper & Webpack Encore setup for Stimulus controllers
- Template Overrides Guide - Customize the admin interface appearance
- Development Guide - Running tests, code quality, and contributing
Features
- 🚀 LiveComponent-Ready: Built for Symfony UX LiveComponents
- 🎨 Template Override System: Hierarchical template resolution for easy customization
- 🔧 Type-Based Rendering: Smart property rendering based on Doctrine types
- 📝 Attribute-Driven: Modern PHP 8+ attribute configuration
- 🔍 Filters & Search: Built-in filtering and search capabilities
- ⚡ Batch Operations: Multi-select with Shift/Ctrl+Click and bulk delete
- 📊 Dashboard & Menu: Configurable admin dashboard and navigation
🏗️ Installation & Quick Start
1. Installation
composer require kachnitel/admin-bundle
The bundle is registered automatically by Symfony Flex. If not using Flex, enable the bundle manually in config/bundles.php:
return [ // ... Kachnitel\AdminBundle\KachnitelAdminBundle::class => ['all' => true], ];
2. Configure the Bundle
Create the bundle configuration file:
# config/packages/kachnitel_admin.yaml kachnitel_admin: base_layout: 'base.html.twig' # Your app's base template required_role: 'ROLE_ADMIN' # Role required to access admin (null for no restriction)
Note: The
kachnitel_admin:key must be present for the bundle to load. Usekachnitel_admin: ~for all defaults.
See the Configuration Guide for all available options.
3. Add Routes
Import the bundle's routes:
# config/routes/kachnitel_admin.yaml kachnitel_admin: resource: '@KachnitelAdminBundle/config/routes.yaml' prefix: /admin
4. Mark Entities with #[Admin] Attribute
Add the #[Admin] attribute to any Doctrine entity:
use Kachnitel\AdminBundle\Attribute\Admin; #[Admin(label: 'Products', icon: 'inventory')] class Product { // ... }
That's it! The entity will now appear in the admin dashboard at /admin.
5. Enable Batch Actions (Optional)
For multi-select and batch delete functionality, you'll need to:
-
Enable batch actions on your entity:
#[Admin(label: 'Products', enableBatchActions: true)] class Product { /* ... */ }
-
Register the Stimulus controller in your asset configuration
→ See the Batch Actions Setup Guide for complete setup instructions.
📋 Installation Summary
| Step | Automated by Flex | Manual Setup Required |
|---|---|---|
Bundle registration (bundles.php) |
✅ Yes | Only if not using Flex |
Config file (kachnitel_admin.yaml) |
✅ Creates template | Customize base_layout, required_role |
| Routes import | ✅ Creates file | Adjust prefix if needed |
Entity #[Admin] attribute |
❌ No | Add to each entity |
| Security/access control | ❌ No | Configure in security.yaml |
| Batch actions Stimulus controller | ❌ No | Manual registration in controllers.json |
| Template overrides | ❌ No | Create in templates/bundles/KachnitelAdminBundle/ |
| Form types for edit/new | ❌ No | Create form classes |
For template customization, see the Template Overrides Guide.
🛠️ Core Technology Stack
Kachnitel Admin is built purely on the established Symfony stack.
It relies only on Symfony, Doctrine ORM, and Live Components (part of the Symfony UX initiative) for all functionality and interactivity. This approach ensures the administration interface is built using server-side PHP without requiring any external JavaScript frameworks or frontend libraries.
Note on Doctrine: While currently dependent on Doctrine ORM, the goal is to decouple this dependency in a future release to allow for integration with other persistence layers/ORMs.
Requirements
- PHP 8.2 or higher
- Symfony 6.4 or 7.0+
- Doctrine ORM 2.0 or 3.0+
License
MIT License - see LICENSE file for details.