Skip to content

Instantly share code, notes, and snippets.

@atillay
Last active November 11, 2021 17:08
Show Gist options
  • Save atillay/866af0fafce99c16febd8a52785962c0 to your computer and use it in GitHub Desktop.
Save atillay/866af0fafce99c16febd8a52785962c0 to your computer and use it in GitHub Desktop.
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
/**
* @ApiResource(
* collectionOperations={
* "post"
* },
* itemOperations={
* "put",
* "put_custom"={
* "method"="PUT",
* "path"="/my-entity/{id}/custom"
* }
* }
* attributes={
* "validation_groups"=App\Validator\ValidationGroupsGenerator::class
* }
* )
*/
class MyEntity {
// same as before
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment