32 lines
581 B
32 lines
581 B
<?php |
|
|
|
namespace App\Providers; |
|
|
|
use Illuminate\Support\ServiceProvider; |
|
|
|
class CatchAllOptionsRequestsProvider extends ServiceProvider |
|
{ |
|
/** |
|
* Bootstrap the application services. |
|
* |
|
* @return void |
|
*/ |
|
public function boot() |
|
{ |
|
} |
|
|
|
/** |
|
* Register the application services. |
|
* |
|
* @return void |
|
*/ |
|
public function register() |
|
{ |
|
$request = app('request'); |
|
|
|
if ($request->isMethod('OPTIONS')) |
|
{ |
|
app()->options($request->path(), function() { return response('', 200); }); |
|
} |
|
} |
|
}
|
|
|