PHP code example of tyloo / api-response-helpers
1. Go to this page and download the library: Download tyloo/api-response-helpers 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/ */
tyloo / api-response-helpers example snippets
namespace App\Controller;
use Tyloo\ApiResponseHelpers;
use Symfony\Component\HttpFoundation\JsonResponse;
class OrdersController
{
use ApiResponseHelpers;
public function index(): JsonResponse
{
return $this->respondWithSuccess();
}
}