I'm using the LaravelCors library and would like to block all requesters except a specific Domain, how do I do this?
I'm using the LaravelCors library and would like to block all requesters except a specific Domain, how do I do this?
If the entire installation has been followed barryvdh / laravel-cors goes in the config
folder and open the file cors.php
and array
of settings, add the address in the allowedOrigins
key as it is now in the example below the address http://www.teste.com
, it can also contain other addresses because it accepts more settings.
return [
/*
|--------------------------------------------------------------------------
| Laravel CORS
|--------------------------------------------------------------------------
|
| allowedOrigins, allowedHeaders and allowedMethods can be set to array('*')
| to accept any value.
|
*/
'supportsCredentials' => false,
'allowedOrigins' => ['http://www.teste.com'],
'allowedHeaders' => ['Content-Type', 'X-Requested-With'],
'allowedMethods' => ['*'], // ex: ['GET', 'POST', 'PUT', 'DELETE']
'exposedHeaders' => [],
'maxAge' => 0,
]