Skip to content

A route generator that generates distinct put and patch endpoints

License

Notifications You must be signed in to change notification settings

brainstudnl/laravel-patchable-api-resource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A route generator that generates distinct put and patch endpoints

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages