PHP code example of flynn314 / allow-cors
1. Go to this page and download the library: Download flynn314/allow-cors 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/ */
flynn314 / allow-cors example snippets
# 1. add to Kernel.php
'cors.allow' => AllowCors::class,
# 2. add middleware to route
Route::middleware(['cors.allow'])->group(function () {
Route::get('/my-api-call', 'Controller@index');
});