PHP code example of razor9999 / cors-lumen
1. Go to this page and download the library: Download razor9999/cors-lumen 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/ */
razor9999 / cors-lumen example snippets
$app->register('razor9999\Cors\Providers\CorsServiceProvider');
$app->routeMiddleware([
'cors' => 'razor9999\Cors\Middleware\CorsMiddleware',
]);
$app->get('/api/test', ['middleware' => 'cors', function() {
//
}]);