chat icon indicating copy to clipboard operation
chat copied to clipboard

Non-static method 'createConversation' should not be called statically

Open yacinegithub opened this issue 3 years ago • 6 comments

Non-static method 'createConversation' should not be called statically

1- When Changing "use Musonza\Chat\Chat" to "use Chat" i get Class 'Chat' not found

2- When adding the facade Chat to config/app.php i get "Argument 1 passed to Musonza\Chat\Chat::__construct() must be an instance of Musonza\Chat\Services\MessageService, instance of Illuminate\Foundation\Application given, called in /home/tawsse59/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 208"

3- am using L8.X

yacinegithub avatar Dec 02 '20 13:12 yacinegithub

In config/app.php add the following to aliases:

        'Chat' => Musonza\Chat\Facades\ChatFacade::class,

And while you're at it, you probably need this too in providers:

        Musonza\Chat\ChatServiceProvider::class,

maarten00 avatar Jan 21 '21 07:01 maarten00

Thank you, it works.

yacinegithub avatar Jan 23 '21 12:01 yacinegithub

I'm trying to use this on a "boot() ::creating" function inside a model but got the same error.

I added both lines in config/app.php and used use Musonza\Chat\Chat; use \Chat; and use Chat;

Without any luck.

Pondake avatar Aug 20 '21 11:08 Pondake

Having the same issue, I tried updating config/app.php but it didn't work for me, I'm using Laravel 8.

FadyBengoufa avatar Sep 07 '21 08:09 FadyBengoufa

+1

salvationarinze avatar Apr 29 '22 07:04 salvationarinze

This works for me in Laravel 9: use Musonza\Chat\Facades\ChatFacade as Chat;

jaimey avatar Jul 30 '22 02:07 jaimey