1. Go to this page and download the library: Download teners/laravel-key-case library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
teners / laravel-key-case example snippets
->withMiddleware(function (Middleware $middleware) {
$middleware->api(append: [
\Teners\LaravelKeyCase\Http\Middleware\TransformResponseMiddleware:class,
]);
})
// Or to use on individual routes
->withMiddleware(function (Middleware $middleware) {
$middleware->alias([
'convert-response-key' => \Teners\LaravelKeyCase\Http\Middleware\TransformResponseMiddleware:class,
]);
})
return [
// Other configuration options...
'ignore' => [
// Common routes to ignore for both request and response transformation
],
'ignoreRequest' => [
// List of routes to ignore for request transformation
],
'ignoreResponse' => [
// List of routes to ignore for response transformation
],
];