PHPackages                             beefeater/crud-event-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. beefeater/crud-event-bundle

ActiveSymfony-bundle[Admin Panels](/categories/admin)

beefeater/crud-event-bundle
===========================

Event-based CRUDL bundle with configurable filtering, pagination, and sorting for Symfony applications

2.3.1(1mo ago)1887↓20%MITPHPPHP &gt;=8.1CI passing

Since Jul 14Pushed 1mo agoCompare

[ Source](https://github.com/Beefeater83/beefeater-crud-event-bundle)[ Packagist](https://packagist.org/packages/beefeater/crud-event-bundle)[ RSS](/packages/beefeater-crud-event-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (34)Versions (45)Used By (0)

Beefeater CRUD Event Bundle
===========================

[](#beefeater-crud-event-bundle)

[![Build Status](https://github.com/Beefeater83/beefeater-crud-event-bundle/actions/workflows/ci.yml/badge.svg)](https://github.com/Beefeater83/beefeater-crud-event-bundle/actions/workflows/ci.yml/badge.svg)

**Beefeater CRUD Event Bundle** is a powerful Symfony bundle for rapid REST API generation with built-in support for CRUD operations, events, pagination, sorting, and filtering.

---

📦 Key Features
--------------

[](#-key-features)

- 🔁 Auto-generation of CRUD routes (`Create`, `Read`, `Update`, `Delete`, `List`, `Patch`) based on YAML configuration
- 📚 API versioning support (e.g., `v1`, `v2`)
- 📄 Pagination, sorting, and filtering for `List` operations
- 🧩 Event-driven architecture (before/after lifecycle events)
- ⚙️ Controller extensibility (custom endpoints + reusable handlers)
- 🔐 Per-operation security configuration
- 🧠 Doctrine ORM integration
- 📤 Optional Excel export for list operations
- 🧾 Validation groups &amp; request data validation
- 🔀 Route parameters support including nested resources and UUIDs
- 📝 Dedicated logging channel support
- ❗ Custom exception handling

---

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Symfony &gt;= 7.2
- Doctrine ORM &gt;= 3.0
- Doctrine Persistence &gt;= 3.3

> The bundle has been tested with these versions. Newer versions should also work.

🔧 Installation
--------------

[](#-installation)

Install the bundle via Composer:

```
composer require beefeater/crud-event-bundle
```

---

🚀 Usage
-------

[](#-usage)

### Register Routes

[](#register-routes)

Add the following to `config/routes.yaml`:

```
crud_api_v1:
    resource: '%kernel.project_dir%/config/crud_routes_v1.yaml'
    type: crud_routes
```

### Example: `crud_routes_v1.yaml`

[](#example-crud_routes_v1yaml)

```
version: v1
resources:
  products:
    entity: App\Entity\Product
    operations: [C, R, U, D, L, P]
    path: /products

  categories:
    entity: App\Entity\Category
    operations: [C, R, U, D, L, P]
    path: /products/{product}/categories
    params:
      product: App\Entity\Product
```

#### Routes generated for `products`:

[](#routes-generated-for-products)

Route NameMethodPathapi\_v1\_products\_CPOST/api/v1/productsapi\_v1\_products\_RGET/api/v1/products/{id}api\_v1\_products\_UPUT/api/v1/products/{id}api\_v1\_products\_DDELETE/api/v1/products/{id}api\_v1\_products\_LGET/api/v1/productsapi\_v1\_products\_PPATCH/api/v1/products/{id}#### Routes generated for `categories`:

[](#routes-generated-for-categories)

Route NameMethodPathapi\_v1\_categories\_CPOST/api/v1/products/{product}/categoriesapi\_v1\_categories\_RGET/api/v1/products/{product}/categories/{id}api\_v1\_categories\_UPUT/api/v1/products/{product}/categories/{id}api\_v1\_categories\_DDELETE/api/v1/products/{product}/categories/{id}api\_v1\_categories\_LGET/api/v1/products/{product}/categoriesapi\_v1\_categories\_PPATCH/api/v1/products/{product}/categories/{id}> ⚠️ If the ***`version:`*** key is **not specified** in the configuration file (e.g. `crud_routes_v1.yaml`), the route paths will be built **without any version prefix**, for example: `/api/categories/{id}`.

---

🗂 Repository Requirement
------------------------

[](#-repository-requirement)

All Doctrine repositories **must extend the bundle’s** `AbstractRepository` to ensure proper:

- Filtering &amp; QuickSearch
- Pagination &amp; Sorting
- UUID handling
- `find()` throws `ResourceNotFoundException`

    **Example**

```
