PHP code example of rizkussef / laravel-snake-to-camel-case

1. Go to this page and download the library: Download rizkussef/laravel-snake-to-camel-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/ */

    

rizkussef / laravel-snake-to-camel-case example snippets


return [
    'convert_response' => true, // Enable snake_case → camelCase for responses
    'convert_request'  => true, // Enable camelCase → snake_case for requests
    'apply_to'         => 'all', // Options: 'all' | 'api' | 'web'
];
bash
php artisan vendor:publish --tag=config

SNAKE_TO_CAMEL_CONVERT_RESPONSE=true
SNAKE_TO_CAMEL_CONVERT_REQUEST=true