sun-asterisk / laravel-chatwork
Chatwork SDK for Laravel
Installs: 8 072
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 5
Forks: 5
Open Issues: 2
Requires
- illuminate/support: ^5.0|^6.0|^7.0
- sun-asterisk/chatwork-php: ^0.1.1
Requires (Dev)
- phpunit/phpunit: ^8.3
This package is auto-updated.
Last update: 2024-11-05 09:58:25 UTC
README
Chatwork SDK for Laravel 5, 6, 7.
Installation
Using composer:
composer require sun-asterisk/laravel-chatwork
For Laravel 5.4 and earlier, add the service provider to your config/app.php
.
'providers' => [ // ... SunAsterisk\Chatwork\Laravel\ServiceProvider::class // ... ];
Configure
First register an API Key here.
Then add the API key to your .env
:
CHATWORK_API_KEY=your_api_key_here
Usage
You can use the provided facade via an alias:
use Chatwork; $me = Chatwork::me(); $members = Chatwork::room($roomId)->members()->list();
Or use dependency injection:
use SunAsterisk\Chatwork\Chatwork; class ChatworkCommand extends Command { public function handle(Chatwork $chatwork) { $message = $chatwork->toAll()->text('Hi there'); $chatwork->room($roomId)->messages()->create($message); } }