PHP code example of abdulnizam / laravel-macros-response-customised

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

    

abdulnizam / laravel-macros-response-customised example snippets

 bash
cp 'vendor/abdulnizam/laravel-macros-response-customised/config/laravelmacros.php' config/laravelmacros.php
 php
return response()->custom([1, 'Welcome to the laravel macros']);
 php
return response()->custom_error([0, 'Welcome to the laravel macros']);
 php
return response()->message('Welcome to laravel macros", 200);
 php
return response()->error('Error message to be displayed', $statuscode = 400);
 php
return response()->success(['dataname' => 'data'], $statuscode = 200);
 php
return response()->pdf($pdfcontent, 'name.pdf', $download = false);