PHPackages                             bentools/api-platform-create-resource - 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. [API Development](/categories/api)
4. /
5. bentools/api-platform-create-resource

ActiveLibrary[API Development](/categories/api)

bentools/api-platform-create-resource
=====================================

Allows creating resources through PUT operations.

0.1.0(6y ago)023MITPHPCI failing

Since Jan 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/api-platform-create-resource)[ Packagist](https://packagist.org/packages/bentools/api-platform-create-resource)[ RSS](/packages/bentools-api-platform-create-resource/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

This bundle is an add-on to [API Platform](https://api-platform.com/) that brings resource creation [through the PUT verb](https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6).

Kind of *upsert* in REST.

This means you can send the following request:

```
PUT /api/books/d9a5551f-f188-45e4-a034-00b744a08a31
Content-Type: application/ld+json
Accept: application/ld+json

{"name":  "Book title"}

```

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](https://github.com/ramsey/uuid) / [ULIDs](https://github.com/bpolaszek/doctrine-ulid) for example).

Installation
------------

[](#installation)

```
composer require bentools/api-platform-create-resource:0.1.*
```

**Important notice:** This bundle must be loaded **before** `ApiPlatformBundle` to work properly.

Configuration
-------------

[](#configuration)

Resource classes which expect this behavior must be explicitely listed:

```
# config/packages/api_platform_create_resource.yaml
api_platform_create_resource:
  allowed_classes:
    App\Entity\Book: ~
```

Resource instanciation
----------------------

[](#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:

```
# config/packages/api_platform_create_resource.yaml
api_platform_create_resource:
  allowed_classes:
    App\Entity\Book: '@App\Services\BookFactory'
```

Tests
-----

[](#tests)

Who cares? 😄

License
-------

[](#license)

MIT.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2299d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acdd1a8ee0e657ddd06cf11f98a32100ef7121afb8aa270a5b295f5c29c038b3?d=identicon)[bpolaszek](/maintainers/bpolaszek)

---

Top Contributors

[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (2 commits)")

### Embed Badge

![Health badge](/badges/bentools-api-platform-create-resource/health.svg)

```
[![Health](https://phpackages.com/badges/bentools-api-platform-create-resource/health.svg)](https://phpackages.com/packages/bentools-api-platform-create-resource)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

55133.7k2](/packages/sulu-headless-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
