maknz / slack-laravel

Laravel integration for the maknz/slack package
BSD 2-Clause "Simplified" License
155 stars 118 forks source link

Error on Laravel 5.4 #10

Open theCowBoiCoder opened 7 years ago

theCowBoiCoder commented 7 years ago

Installed the package on Laravel 5.4 and got the following error below:

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Foundation\Application::share()

Are you going to add a fix for the new framework?

weseldridge commented 7 years ago

This should be the correct change. In the middle of testing it now, but I am open for input.

public function register()
    {
        $this->mergeConfigFrom(__DIR__.'/config/config.php', 'slack');

        $this->app->singleton('Maknz\Slack\Client', 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'),
                    'markdown_in_attachments' => $app['config']->get('slack.markdown_in_attachments'),
                ],
                new Guzzle
            );
        });
    }
alexc-hollywood commented 7 years ago

+1 on this.

connorjburton commented 7 years ago

See #11

alexc-hollywood commented 7 years ago

I have 3 clients waiting on updates for this (awesome) package - their site reporting goes through Slack. Can't deploy updates until we have 5.4 compatibility.

theCowBoiCoder commented 7 years ago

Perfect thanks!

alexc-hollywood commented 7 years ago

@connorjburton Using your fork for now chap, as it doesn't look like an update is coming soon. Thanks for putting that together!

connorjburton commented 7 years ago

I'll make sure not to delete it then!

aewing commented 7 years ago

I hate to be that guy, but +1

mikerogne commented 7 years ago

+1

AlexDanault commented 7 years ago

Guys, @maknz said on twitter that he doesn't have time to maintain this package anymore and will soon post a deprecation notice.

Link: https://twitter.com/maknz/status/833866298232754177

elynnaie commented 7 years ago

That's disappointing. I guess I will be refactoring my code to use https://laravel.com/docs/5.4/notifications#slack-prerequisites instead of this package.

mikerogne commented 7 years ago

Ah, thanks Alex. Bummer though.

AlexDanault commented 7 years ago

It's sad, but we have to be thankful for @maknz and the time he spent on this. The code is still there, easily forkable. If someone feels like it, is so easy to take it over (we even have @maknz 's ok) and ensure this lives on. In the end, if he doesn't have time to maintain it anymore, so be it, we shouldn't be mad at him.

@denaje I too went in that direction. It was a great opportunity to move towards official framework code. I had to dig in the source code to figure out how to post attachments that are full with (what used to be short-false in this lib) but in the end I got everything up and running.

ganchuhang commented 7 years ago

Any god, please help...

fezanqadirbhatti commented 7 years ago

No compatibility for Laravel 5.4

mllavez commented 7 years ago

Fixed-> https://github.com/ketosthegreat/slack-laravel https://github.com/ketosthegreat/slack-laravel/commit/3d6760e2ab4eaca6830d9f9359ac205625a2602d

PixellUp commented 7 years ago

I think this repo is dead and should be transferred to organization or person who will maintain it. @maknz

ganchuhang commented 7 years ago

@PixellUp Yup, I agree on it.

stueynet commented 7 years ago

How about this one? We are working off a fork with your fix @ketosthegreat so thanks for that.

{"message":"Unresolvable dependency resolving [Parameter #0 [ <required> $endpoint ]] in class Maknz\\Slack\\Client","status_code":500}
stueynet commented 7 years ago

Here is the fix for my issue above: https://github.com/getmaple/slack-laravel/commit/2e9b7c0188728ecc32196259bccd6a8f1df88eca