PHP code example of ejetar / laravel-api-response-formatter

1. Go to this page and download the library: Download ejetar/laravel-api-response-formatter 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/ */

    

ejetar / laravel-api-response-formatter example snippets


Route::middleware(['cors', 'api-response-formatter'])->prefix('/v1')->name('api.')->group(function() {
    Route::prefix('users')->name('users.')->group(function () {
        Route::get('me', 'UsersController@me')->name('me');
    });
});