slack-laravel icon indicating copy to clipboard operation
slack-laravel copied to clipboard

Error on Laravel 5.4

Open theCowBoiCoder opened this issue 8 years ago • 20 comments

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?

theCowBoiCoder avatar Jan 25 '17 19:01 theCowBoiCoder

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
            );
        });
    }

weseldridge avatar Jan 28 '17 15:01 weseldridge

+1 on this.

alexc-hollywood avatar Jan 28 '17 23:01 alexc-hollywood

See #11

connorjburton avatar Jan 30 '17 08:01 connorjburton

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.

alexc-hollywood avatar Jan 30 '17 18:01 alexc-hollywood

Perfect thanks!

theCowBoiCoder avatar Jan 30 '17 20:01 theCowBoiCoder

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

alexc-hollywood avatar Jan 31 '17 16:01 alexc-hollywood

I'll make sure not to delete it then!

connorjburton avatar Jan 31 '17 20:01 connorjburton

I hate to be that guy, but +1

aewing avatar Feb 14 '17 19:02 aewing

+1

mikerogne avatar Feb 23 '17 19:02 mikerogne

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

AlexDanault avatar Feb 23 '17 19:02 AlexDanault

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.

elynnaie avatar Feb 23 '17 19:02 elynnaie

Ah, thanks Alex. Bummer though.

mikerogne avatar Feb 23 '17 20:02 mikerogne

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.

AlexDanault avatar Feb 24 '17 14:02 AlexDanault

Any god, please help...

ganchuhang avatar Mar 22 '17 10:03 ganchuhang

No compatibility for Laravel 5.4

fezanqadirbhatti avatar Apr 05 '17 09:04 fezanqadirbhatti

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

mllavez avatar May 18 '17 21:05 mllavez

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

PixellUp avatar May 20 '17 10:05 PixellUp

@PixellUp Yup, I agree on it.

ganchuhang avatar May 21 '17 04:05 ganchuhang

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 avatar May 25 '17 15:05 stueynet

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

stueynet avatar May 25 '17 19:05 stueynet