PHP code example of devboxr / response-helper

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

    

devboxr / response-helper example snippets




use Devboxr\Helpers;

/**
 * There are more examples and the ResponseHelper is extended all the time.
 */

// will return a status 200
ResponseHelper::success();

// will return a status 404
ResponseHelper::notFound();

 // will return a status 500
ResponseHelper::serverError();

// Server error 500 with a reason
ResponseHelper::serverError(500, ['error' => 'Could not contact external provider.']);