From e7c58653f79f49e8e06aef034c7fed105d3d696b Mon Sep 17 00:00:00 2001 From: Rohan Sakhale Date: Tue, 14 Nov 2017 15:21:21 +0530 Subject: [PATCH 1/3] Fix for Laravel 5.5 --- src/ServiceProviderLaravel5.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ServiceProviderLaravel5.php b/src/ServiceProviderLaravel5.php index 78812fb05..f78f8de0a 100644 --- a/src/ServiceProviderLaravel5.php +++ b/src/ServiceProviderLaravel5.php @@ -2,8 +2,8 @@ namespace Maknz\Slack\Laravel; -use Maknz\Slack\Client as Client; use GuzzleHttp\Client as Guzzle; +use Maknz\Slack\Client as Client; class ServiceProviderLaravel5 extends \Illuminate\Support\ServiceProvider { @@ -14,7 +14,7 @@ class ServiceProviderLaravel5 extends \Illuminate\Support\ServiceProvider */ public function boot() { - $this->publishes([__DIR__.'/config/config.php' => config_path('slack.php')]); + $this->publishes([__DIR__ . '/config/config.php' => config_path('slack.php')]); } /** @@ -24,9 +24,9 @@ public function boot() */ public function register() { - $this->mergeConfigFrom(__DIR__.'/config/config.php', 'slack'); + $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'slack'); - $this->app['maknz.slack'] = $this->app->share(function ($app) { + $this->app['maknz.slack'] = $this->app->singleton('maknz.slack', function ($app) { return new Client( $app['config']->get('slack.endpoint'), [ From a07ab0c27c9c6cc1c324aa2f0991ec8a2dfab898 Mon Sep 17 00:00:00 2001 From: Rohan Sakhale Date: Fri, 15 Dec 2017 10:35:16 +0530 Subject: [PATCH 2/3] Singleton usage update --- src/ServiceProviderLaravel5.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ServiceProviderLaravel5.php b/src/ServiceProviderLaravel5.php index f78f8de0a..228e1f796 100644 --- a/src/ServiceProviderLaravel5.php +++ b/src/ServiceProviderLaravel5.php @@ -26,17 +26,17 @@ public function register() { $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'slack'); - $this->app['maknz.slack'] = $this->app->singleton('maknz.slack', function ($app) { + $this->app->singleton('maknz.slack', function ($app) { return new Client( $app['config']->get('slack.endpoint'), [ - 'channel' => $app['config']->get('slack.channel'), - 'username' => $app['config']->get('slack.username'), - 'icon' => $app['config']->get('slack.icon'), - 'link_names' => $app['config']->get('slack.link_names'), - 'unfurl_links' => $app['config']->get('slack.unfurl_links'), - 'unfurl_media' => $app['config']->get('slack.unfurl_media'), - 'allow_markdown' => $app['config']->get('slack.allow_markdown'), + 'channel' => $app['config']->get('slack.channel'), + 'username' => $app['config']->get('slack.username'), + 'icon' => $app['config']->get('slack.icon'), + 'link_names' => $app['config']->get('slack.link_names'), + 'unfurl_links' => $app['config']->get('slack.unfurl_links'), + 'unfurl_media' => $app['config']->get('slack.unfurl_media'), + 'allow_markdown' => $app['config']->get('slack.allow_markdown'), 'markdown_in_attachments' => $app['config']->get('slack.markdown_in_attachments'), ], new Guzzle From 20af4055146bffad5b447fcdfd35a1448314fc52 Mon Sep 17 00:00:00 2001 From: Rohan Sakhale Date: Fri, 15 Dec 2017 10:40:43 +0530 Subject: [PATCH 3/3] Added Auto Discoery package --- composer.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c65918ff2..8b8390dd6 100644 --- a/composer.json +++ b/composer.json @@ -18,5 +18,15 @@ "Maknz\\Slack\\Laravel\\": "src/" } }, - "minimum-stability": "stable" + "minimum-stability": "stable", + "extra": { + "laravel": { + "providers": [ + "Maknz\\Slack\\Laravel\\ServiceProvider" + ], + "aliases": { + "Slack": "Maknz\\Slack\\Laravel\\Facade" + } + } + } }