https://github.com/brainstudnl/laravel-patchable-api-resource
A route generator that generates distinct put and patch endpoints
https://github.com/brainstudnl/laravel-patchable-api-resource
Last synced: 5 months ago
JSON representation
A route generator that generates distinct put and patch endpoints
- Host: GitHub
- URL: https://github.com/brainstudnl/laravel-patchable-api-resource
- Owner: brainstudnl
- License: mit
- Created: 2022-03-30T13:46:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-07-14T13:30:51.000Z (11 months ago)
- Last Synced: 2025-11-15T15:25:46.019Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
composer require brainstud/laravel-patchable-api-resource
```
Add the following to `bootstrap/app.php`:
```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.
```php
// 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](LICENSE)