composer require kevin-kibet/laravel-ejabberd
You can publish the configuration file using this command
$ php artisan vendor:publish --provider="Ejabberd\Providers\EjabberdServiceProvider"
<?php
return [
'api' => env('EJABBERD_API', 'http://im.conversations.com/api'),
'domain' => env('EJABBERD_DOMAIN', 'conversations.com'),
'conference_domain' => env('EJABBERD_CONFERENCE_DOMAIN', 'conference.conversations.com'),
'user' => env('EJABBERD_USER', 'admin'),
'password' => env('EJABBERD_PASSWORD', 'password'),
'debug' => env('EJABBERD_DEBUG', true)
];
Register the service provider: In your config/app.php
'providers' => [
// Other Service Providers
Ejabberd\Providers\EjabberdServiceProvider::class
],
To load the configuration, in your bootstrap/app.php
$app->configure('ejabberd')
Register the service provider
$app->register(Ejabberd\Providers\EjabberdServiceProvider::class);
Register a new user to your xmpp server
$create_user = new CreateUser($user, $password, $host);
$response = EjabberedFacade::createUser($create_user);
Send message to a user or conference
$send_message = new SendMessage($type, $from, $to, $subject, $body);
$response = EjabberedFacade::sendMessage($send_message);