A route generator that generates distinct put and patch endpoints
brainstud/laravel-patchable-api-resource is a Laravel package for a route generator that generates distinct put and patch endpoints.
It currently has 0 GitHub stars and 5.969 downloads on Packagist (latest version v2.0.0).
Install it with composer require brainstud/laravel-patchable-api-resource.
Discover more Laravel packages by brainstud
or browse all Laravel packages to compare alternatives.
Last updated
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.
Require the package
composer require brainstud/laravel-patchable-api-resource
Add the following to bootstrap/app.php:
$app->singleton(
'router',
\Brainstud\PatchableApiResource\PatchableApiResourceRouter::class
);
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);
laravel-patchable-api-resource is open-sourced software licensed under the MIT License