egarabini / laravel-rocket-chat
Rocket Chat REST API client for Laravel 7.x.
Installs: 2 058
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- illuminate/support: ^7.0
- nategood/httpful: *
This package is not auto-updated.
Last update: 2024-05-14 12:03:32 UTC
README
laravel-rocket-chat is a rest client package for Laravel to communicate with Rocket.Chat API.
How to install
composer require egarabini/laravel-rocket-chat
Config && Facades
Open your Laravel config file config/app.php and in the $providers
array add the service provider for this package.
\Timetorock\LaravelRocketChat\Provider\LaravelRocketChatServiceProvider::class
Publish config for admin user
Generate the configuration file running in the console (only if you added LaravelRocketChatProvider) :
php artisan vendor:publish --tag=config
Write api url, admin credentials, otherwise you'll need to login as user to make requests. By default this package login as admin to make requests.
Example
<?php $userClient = new \Timetorock\LaravelRocketChat\Client\UserClient(); $userClient->create(new \Timetorock\LaravelRocketChat\Models\User([ 'email'=> 'test@test.com', 'name' => 'test', 'password' => '12345', 'username' => 'test', ])) ?>