1. Go to this page and download the library: Download wamesk/laravel-api-response 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/ */
return ApiResponse::code('1.2', 'user')->response(201); // return "message": "user.1.2" as in Response example
return ApiResponse::code('1.2')->response(201); // When not provided second parameter it will use default and return "message": "api.1.2"