brainstud/laravel-patchable-api-resource

A route generator that generates distinct put and patch endpoints
6,108
Install
composer require brainstud/laravel-patchable-api-resource
Latest Version:v2.0.0
PHP:^8.5
License:MIT
Last Updated:Apr 16, 2026
Links: GitHub  ·  Packagist
Maintainer: Diondb

Laravel Patchable API Resource

laravel-patchable-api-resource is a faster way to register patchable API resources in your routes file.

By registering a route as patchable-api-resource it differentiates between PUT and PATCH and calls the update() or patch() method on your controller.

Installation

Require the package

composer require brainstud/laravel-patchable-api-resource

Add the following to bootstrap/app.php:

$app->singleton(
    'router',
    \Brainstud\PatchableApiResource\PatchableApiResourceRouter::class
);

Usage

Registering a patchable API-resource works the same as the default Route::apiResource and Route::apiResources methods.

// api.php

Route::patchableApiResources([
    'items' => ItemsController::class,
]);

Route::patchableApiResource('items', ItemController::class);

License

laravel-patchable-api-resource is open-sourced software licensed under the MIT License

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v2.0.0 ^8.5 ^12.0||^13.0 MIT
v1.0.12 ^8.2 ^10|^11.0|^12.0 MIT
v1.0.11 ^8.2 ^6|^7|^8|^9|^10|^11.0 MIT
v1.0.10 ^8.1 ^6|^7|^8|^9|^10 MIT
v1.0.9 ^8.0 || ^9.0 ^6|^7|^8|^9 MIT