Skip to content

Instantly share code, notes, and snippets.

@atillay
Last active November 11, 2021 12:16
Show Gist options
  • Save atillay/b9a67156d2979961ff48c0eb82ef2df8 to your computer and use it in GitHub Desktop.
Save atillay/b9a67156d2979961ff48c0eb82ef2df8 to your computer and use it in GitHub Desktop.
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
/**
* @ApiResource(
* collectionOperations={
* "get",
* "post"
* },
* itemOperations={
* "get",
* "get_custom"={"method"="GET", "path"="/my-entity/{id}/custom"},
* "put",
* "put_custom"={"method"="PUT", "path"="/my-entity/{id}/custom"}
* }
* )
*/
class MyEntity {
// stays identical
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment