Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Laravel 5.5 #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/ServiceProviderLaravel5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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')]);
}

/**
Expand All @@ -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) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work . You don't need to reassign $this->app['maknz.slack'] with the returned value from app->singleton since you already define the name for the singleton as a parameter to the function

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please review my change and accept, have tested locally over tinker, Slack command works

return new Client(
$app['config']->get('slack.endpoint'),
[
Expand Down