Download the PHP package phpsa/laravel-case-remapping without Composer
On this page you can find all versions of the php package phpsa/laravel-case-remapping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpsa/laravel-case-remapping
More information about phpsa/laravel-case-remapping
Files in phpsa/laravel-case-remapping
Package laravel-case-remapping
Short Description Methods to allow the mapping of cases to snake / camel for input / output
License MIT
Homepage https://github.com/phpsa/laravel-case-remapping
Informations about the package laravel-case-remapping
Methods to allow the mapping of cases to snake / camel for input / output
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Installation
You can install the package via composer:
Usage - Middlware for incomming requests
Add as a middleware:
Phpsa\LaravelCaseRemapping\Http\Middleware\SnakeCaseInputs
to your route eg:
in your controllers constructor:
Or globally via the app/Http.Kernal.php
file
Usage - Response wrapping for your Transformers / Response objects
add the following trait to your resource:
\Phpsa\LaravelCaseRemapping\Http\Resources\WithAcceptedCase
then in your toArray
method change to per example
based on the header value for X-Accept-Case-Type
passed to the request it will reaturn one of the following
camel
, kebab
, snake
Usage - Collection methods
This packages includes 3 collecion macros:
- snakeKeys - will convert all array keys to snake case
- camelKeys - will convert all array keys to camel case
- kebabKeys - will convert all array keys to kebab case
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Craig Smith
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-case-remapping with dependencies
spatie/laravel-package-tools Version ^1.4.3
illuminate/contracts Version ^8.41