Download the PHP package bentools/api-platform-create-resource without Composer
On this page you can find all versions of the php package bentools/api-platform-create-resource. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bentools/api-platform-create-resource
More information about bentools/api-platform-create-resource
Files in bentools/api-platform-create-resource
Package api-platform-create-resource
Short Description Allows creating resources through PUT operations.
License MIT
Informations about the package api-platform-create-resource
This bundle is an add-on to API Platform that brings resource creation through the PUT verb.
Kind of upsert in REST.
This means you can send the following request:
If /api/books/d9a5551f-f188-45e4-a034-00b744a08a31
doesn't exist, this resource will be created,
otherwise its content will be replaced; as of the specification.
This way, your client doesn't have to care whether or not it should POST or PUT, it always PUTs. This involves that you delegate the resource ID generation to the client side (which may be done with UUIDs / ULIDs for example).
Installation
Important notice: This bundle must be loaded before ApiPlatformBundle
to work properly.
Configuration
Resource classes which expect this behavior must be explicitely listed:
Resource instanciation
If your entity/object needs a factory service to instanciate it,
you can implement your own BenTools\ApiPlatform\CreateResource\Factory\ItemFactoryInterface
and reference it as a service:
Tests
Who cares? 😄
License
MIT.
All versions of api-platform-create-resource with dependencies
symfony/dependency-injection Version ~3.0|~4.0|~5.0
symfony/config Version ~3.0|~4.0|~5.0
symfony/http-kernel Version ~3.0|~4.0|~5.0