PHP code example of dragonfire1119 / cors-lumen

1. Go to this page and download the library: Download dragonfire1119/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/ */

    

dragonfire1119 / cors-lumen example snippets


$app->register('Dragonfire1119\Cors\Providers\CorsServiceProvider');

$app->routeMiddleware([
	'cors' => 'Dragonfire1119\Cors\Middleware\CorsMiddleware',
]);

$app->get('/api/test', ['middleware' => 'cors', function() {
    //
}]);