slack-laravel
slack-laravel copied to clipboard
Error on Laravel 5.4
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?
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
);
});
}
+1 on this.
See #11
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.
Perfect thanks!
@connorjburton Using your fork for now chap, as it doesn't look like an update is coming soon. Thanks for putting that together!
I'll make sure not to delete it then!
I hate to be that guy, but +1
+1
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
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.
Ah, thanks Alex. Bummer though.
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.
Any god, please help...
No compatibility for Laravel 5.4
Fixed-> https://github.com/ketosthegreat/slack-laravel https://github.com/ketosthegreat/slack-laravel/commit/3d6760e2ab4eaca6830d9f9359ac205625a2602d
I think this repo is dead and should be transferred to organization or person who will maintain it. @maknz
@PixellUp Yup, I agree on it.
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}
Here is the fix for my issue above: https://github.com/getmaple/slack-laravel/commit/2e9b7c0188728ecc32196259bccd6a8f1df88eca