PHPackages                             bigchicchicken/api-platform-auto-group-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. bigchicchicken/api-platform-auto-group-bundle

ActiveApi-platform-bundle

bigchicchicken/api-platform-auto-group-bundle
=============================================

Bundle to define automatically all groups on all entities for ApiPlatform

v1.0.1(3y ago)18MITPHPPHP &gt;=8.1

Since Sep 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/BigChicChicken/ApiPlatformAutoGroupBundle)[ Packagist](https://packagist.org/packages/bigchicchicken/api-platform-auto-group-bundle)[ Docs](https://github.com/BigChicChicken/ApiPlatformAutoGroupBundle)[ RSS](/packages/bigchicchicken-api-platform-auto-group-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

ApiPlatformAutoGroupBundle
==========================

[](#apiplatformautogroupbundle)

[![Packagist](https://camo.githubusercontent.com/f8285cb09c9a863c0d54d470b6440320421989303cb6fce9aabc5192f07bd3b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62696763686963636869636b656e2f6170692d706c6174666f726d2d6175746f2d67726f75702d62756e646c653f7374796c653d706c61737469632e737667)](https://packagist.org/packages/bigchicchicken/api-platform-auto-group-bundle)

Bundle to define automatically all groups on all entities for [ApiPlatform](https://api-platform.com/).

Installation:
-------------

[](#installation)

Install ApiPlatformAutoGroupBundle library using [Composer](https://getcomposer.org/):

```
composer require bigchicchicken/api-platform-auto-group-bundle
```

Add/Check activation in the file `config/bundles.php`:

```
// config/bundles.php

return [
    // ...
    ApiPlatformAutoGroupBundle\ApiPlatformAutoGroupBundle::class => ['all' => true],
];
```

Override the default group naming strategy
------------------------------------------

[](#override-the-default-group-naming-strategy)

By default, the following strategy is applied to all entities:

> Normalization groups:
>
> {ShortName}:read
>
> {ShortName}:read:{OperationName}

> Denormalization groups:
>
> {ShortName}:write
>
> {ShortName}:write:{OperationName}

(Default operation name: `GetCollection` `Post` `Get` `Put` `Delete` `Patch`)

But if you want to use your custom strategy, just override the service like that:

- Create a file that extend from `AutoGroupResourceMetadataCollectionFactory`.

```
