PHP code example of appstract / laravel-response-macros

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

    

appstract / laravel-response-macros example snippets

 php
return response()->message('hello world!', 200);
 php
return response()->error('Something went wrong', $statuscode = 400);
 php
return response()->success(['some' => 'data'], $statuscode = 200);
 php
return response()->pdf($pdfData, 'filename.pdf', $download = false);