rocketfirm / mattermost-driver
This Driver is a PHP implementation of the official Mattermost Web Services API.
dev-main
2025-02-26 12:08 UTC
Requires
- php: ^8.2
- laravel/framework: ^9.0||^10.0||^11.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.63
This package is auto-updated.
Last update: 2025-04-19 12:08:25 UTC
README
The Laravel Driver to interact with the Mattermost Web Service API.
Please read the api documentation for further information on using this application.
Installation
Composer
The best way to install mattermost-driver is to use Composer:
composer require rocketfirm/mattermost-driver
Read more about how to install and use Composer on your local machine here.
Laravel
After installation launch the command:
php artisan vendor:publish
to publish the configuration file. You'll find it at config/mattermost.php
Configuration
Edit the file config/mattermost.php
as you prefer.
Usage
use \Rocketfirm\MattermostDriver\Facades\Mattermost; // Retrieve the driver $driver = Mattermost::server('default'); // Retrieve the User Model $userModel = $driver->getUserEndpoint(); // Retrieve the User Model directly (on the default server) $userModel = Mattermost::server()->getUserEndpoint();
Via dependency injection
use \Rocketfirm\MattermostDriver\Contracts\DriverContract; // Retrieve the driver $mattermost = app()->make(DriverContract::class); // Retrieve the User Model $userModel = $driver->getUserEndpoint();