1. Go to this page and download the library: Download chuoke/response4laravel 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/ */
chuoke / response4laravel example snippets
use Chuoke\Response4Laravel\Concerns\ResponseHelper;
use Chuoke\Response4Laravel\Response;
protected function apiResponse() {
return Response::make();
}
$this->response()->ok(); // or $this->response()->ok($data)
$this->response()->created($data, 'The data was created successfule!');
$this->response()->notFound('The data not exists');
$this->response()->badRequest('Your submit is wrong.');