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

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

Open
yacinegithub opened this issue Dec 2, 2020 · 6 comments

Comments

@yacinegithub
Copy link

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

@maarten00
Copy link

maarten00 commented Jan 21, 2021

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,

@yacinegithub
Copy link
Author

Thank you, it works.

@Pondake
Copy link

Pondake commented Aug 20, 2021

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.

@FadyBengoufa
Copy link

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

@salvationarinze
Copy link

+1

@jaimey
Copy link

jaimey commented Jul 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants