1. Go to this page and download the library: Download abellion/laravel-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/ */
abellion / laravel-cors example snippets
Abellion\Cors\LaravelServiceProvider::class
use Abellion\Cors\Middleware\OriginsMiddleware;
OriginsMiddleware::$ORIGINS = [
"/https:\/\/(www\.)?([a-z0-9]+\.)?mydomain\.(com|fr)/",
"/http(s)?:\/\/(www\.)?localhost(:[0-9]+)?/"
];