PHP code example of barryvdh / laravel-cors

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

    

barryvdh / laravel-cors example snippets


protected $middleware = [
  \Fruitcake\Cors\HandleCors::class,
    // ...
];

'paths' => ['api/*'],

$app->register(Fruitcake\Cors\CorsServiceProvider::class);

$app->configure('cors');

$app->middleware([
    // ...
    Fruitcake\Cors\HandleCors::class,
]);

protected $except = [
    'api/*',
    'sub.domain.zone' => [
      'prefix/*'
    ],
];
sh
php artisan vendor:publish --tag="cors"