1. Go to this page and download the library: Download lemric/batch-request 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/ */
use Lemric\BatchRequest\Bridge\Symfony\SymfonyBatchRequestFacade;
use Symfony\Component\HttpFoundation\{Request, Response};
use Symfony\Component\Routing\Attribute\Route;
#[Route('/batch', name: 'batch', methods: ['POST'])]
public function batch(Request $request, SymfonyBatchRequestFacade $batch): Response
{
return $batch->handle($request);
}
// bootstrap/providers.php (Laravel 11+) or config/app.php
Lemric\BatchRequest\Bridge\Laravel\LaravelServiceProvider::class,
use Illuminate\Http\{JsonResponse, Request};
use Lemric\BatchRequest\Bridge\Laravel\LaravelBatchRequestFacade;
public function __invoke(Request $request, LaravelBatchRequestFacade $batch): JsonResponse
{
return $batch->handle($request);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.