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

0.1.0 2025-12-13 05:35 UTC

This package is auto-updated.

Last update: 2025-12-22 22:07:48 UTC


README

Tests Coverage Assertions PHPStan PHP Symfony

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

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. Use kachnitel_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:

  1. Enable batch actions on your entity:

    #[Admin(label: 'Products', enableBatchActions: true)]
    class Product { /* ... */ }
  2. 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.