From c32c4d4b6f1155c510c321e87ac901abe8aa4f49 Mon Sep 17 00:00:00 2001 From: overtrue Date: Wed, 25 Jan 2017 23:14:18 +0800 Subject: [PATCH] Fix laravel 5.4 issue. #63 --- src/ServiceProvider.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index e92c2c4..562ee5a 100755 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -2,7 +2,7 @@ namespace Overtrue\LaravelWechat; -use EasyWeChat\Foundation\Application; +use EasyWeChat\Foundation\Application as EasyWeChatApplication; use Illuminate\Foundation\Application as LaravelApplication; use Illuminate\Support\ServiceProvider as LaravelServiceProvider; use Laravel\Lumen\Application as LumenApplication; @@ -59,7 +59,7 @@ protected function setupConfig() */ public function register() { - $this->app->singleton(\EasyWeChat\Foundation\Application::class, function ($app) { + $this->app->singleton(EasyWeChatApplication::class, function ($app) { $app = new Application(config('wechat')); if (config('wechat.use_laravel_cache')) { @@ -68,6 +68,9 @@ public function register() return $app; }); + + $this->app->alias(EasyWeChatApplication::class, 'wechat'); + $this->app->alias(EasyWeChatApplication::class, 'easywechat'); } /** @@ -77,7 +80,7 @@ public function register() */ public function provides() { - return ['wechat', 'EasyWeChat\\Foundation\\Application']; + return ['wechat', EasyWeChatApplication::class]; } /**