From bd965ddb25944da2c071f2fb294b84ddd525aa1f Mon Sep 17 00:00:00 2001 From: Seven Du Date: Wed, 14 Mar 2018 18:28:38 +0800 Subject: [PATCH] fix: Fixed bug 1 --- .../Providers/LaravelServiceProvider.php | 17 +---------------- src/Request.php | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Laravel/Providers/LaravelServiceProvider.php b/src/Laravel/Providers/LaravelServiceProvider.php index 79d55e7..74ba089 100644 --- a/src/Laravel/Providers/LaravelServiceProvider.php +++ b/src/Laravel/Providers/LaravelServiceProvider.php @@ -19,7 +19,7 @@ class LaravelServiceProvider extends ServiceProvider * * @author Seven Du */ - protected $defer = true; + protected $defer = false; /** * Bootstrap the CORS service provider. @@ -57,7 +57,6 @@ public function register() $this->mergeConfigFrom(__DIR__.'/../../../config/cors.php', 'cors'); // Register the CORS server instance alias. - $this->app->alias(CorsInterface::class, CorsInterface::class); $this->app->alias(CorsInterface::class, Cors::class); // Register CORS servise singleton. @@ -68,18 +67,4 @@ public function register() return new Cors($config); }); } - - /** - * Get the services provided by the provider. - * - * @return array - * - * @author Seven Du - */ - public function providers() - { - return [ - CorsInterface::class, Cors::class, - ]; - } } diff --git a/src/Request.php b/src/Request.php index ad97cfc..c0a9b7c 100644 --- a/src/Request.php +++ b/src/Request.php @@ -34,7 +34,7 @@ public function __construct(string $type, $request = null) $this->request = $request; // $request not is framework interface, using global veriable $_REQUEST - if ($this->type === 'array' || !$response || is_array($response)) { + if ($this->type === 'array' || !$request || is_array($request)) { $this->request = array_merge($_REQUEST, (array) $request); $this->type = 'array'; }