laravel-mattermost-driver
[![Latest Stable Version][7]][8]
[![Total Downloads][9]][10], (*1)
A Laravel integration for the package php-mattermost-driver., (*2)
Please referer to the php-mattermost-driver package for further information on using this application., (*3)
Installation
Composer
The best way to install php-mattermost-driver is to use Composer:, (*4)
composer require gnello/laravel-mattermost-driver
Read more about how to install and use Composer on your local machine here., (*5)
Laravel
After installation launch the command:, (*6)
php artisan vendor:publish
to publish the configuration file. You'll find it at config/mattermost.php, (*7)
If you're on Laravel 5.5 or higher you can wipe the sweat on your forehead: you're done here!, (*8)
Laravel 5.4 or lower
Otherwise don't give up, you're almost there! Do this:
Add the Gnello\Mattermost\Laravel\MattermostServiceProvider
provider to the providers array in config/app.php:, (*9)
'providers' => [
//..
Gnello\Mattermost\Laravel\MattermostServiceProvider::class,
],
Then add the facade to your aliases array:, (*10)
'aliases' => [
//..
'Mattermost' => Gnello\Mattermost\Laravel\Facades\Mattermost::class,
],
You did it! Now consider updating your version of Laravel!, (*11)
Configuration
Edit the file config/mattermost.php
as you prefer., (*12)
Usage
```php
use \Gnello\Mattermost\Laravel\Facades\Mattermost;, (*13)
//Retrieve the driver
$driver = Mattermost::server('default');, (*14)
//Retrieve the User Model
$userModel = $driver->getUserModel();, (*15)
//Retrieve the User Model directly (on the default server)
$userModel = Mattermost::getUserModel();
```, (*16)