From 64e3ab9ddd70776c6dc6df736c0a71ca5d86b875 Mon Sep 17 00:00:00 2001 From: spektra2147 Date: Wed, 8 Jun 2022 18:44:14 +0300 Subject: [PATCH] fix cors --- composer.json | 8 ++++++-- config/app.php | 1 + config/streams.php | 12 +++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index a936f1070..0f5837b9f 100644 --- a/composer.json +++ b/composer.json @@ -94,7 +94,8 @@ "visiosoft/base-theme": "^1.0", "visiosoft/advs-module": "^1.0", "visiosoft/json-field_type": "^1.0", - "visiosoft/language_switcher-plugin": "^1.0" + "visiosoft/language_switcher-plugin": "^1.0", + "fruitcake/laravel-cors": "^2.0" }, "replace": { "anomaly/streams-platform": "*" @@ -149,6 +150,9 @@ "config": { "bin-dir": "bin", "preferred-install": "dist", - "optimize-autoloader": true + "optimize-autoloader": true, + "allow-plugins": { + "visiosoft/composer-merge-plugin": true + } } } diff --git a/config/app.php b/config/app.php index 2cd53f0ca..027fc29a0 100644 --- a/config/app.php +++ b/config/app.php @@ -209,6 +209,7 @@ return [ */ Anomaly\Streams\Platform\StreamsServiceProvider::class, Sentry\Laravel\ServiceProvider::class, + \Fruitcake\Cors\CorsServiceProvider::class ], /* diff --git a/config/streams.php b/config/streams.php index 7add737bb..51fb52e50 100644 --- a/config/streams.php +++ b/config/streams.php @@ -3,7 +3,7 @@ use App\Exceptions\ExceptionHandler; return [ - + /* |-------------------------------------------------------------------------- | Listeners @@ -32,7 +32,7 @@ return [ */ 'bindings' => [ - 'Anomaly\Streams\Platform\Exception\ExceptionHandler' => ExceptionHandler::class + 'Anomaly\Streams\Platform\Exception\ExceptionHandler' => ExceptionHandler::class ], /* @@ -90,7 +90,9 @@ return [ | */ - 'middleware' => [], + 'middleware' => [ + \Fruitcake\Cors\HandleCors::class, # this line + ], /* |-------------------------------------------------------------------------- @@ -129,7 +131,7 @@ return [ */ 'middleware_priority' => [], - + /* |-------------------------------------------------------------------------- | View Overrides @@ -140,7 +142,7 @@ return [ */ 'overrides' => [], - + /* |-------------------------------------------------------------------------- | Control Panel Customization