Download the PHP package elfsundae/laravel-bearychat without Composer
On this page you can find all versions of the php package elfsundae/laravel-bearychat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-bearychat
BearyChat for Laravel
The Laravel integration for BearyChat to send robot messages.
This package is compatible with Laravel 4/5/6/7/8 and Lumen.
- :cn: 中文文档
- Laravel Notification Channel: BearyChatChannel
Contents
- Installation
- Laravel 5/6/7/8
- Laravel 4
- Lumen
- Usage
- Basic Usage
- Asynchronous Message
- Sending Laravel Exceptions
- Creating Outgoing Responses
- Customize Guzzle
- Changelog
- Testing
- License
Installation
You can install this package using the Composer manager:
After updating composer, you may configure your app according to the following steps:
Laravel 5/6/7/8
For Laravel 5.5+, the service provider will automatically get registered.
Add the service provider to the providers
array in config/app.php
:
Register facade:
Then publish the config file:
Next, configure your BearyChat clients by editing the config file in config/bearychat.php
.
Laravel 4
Please install version 1.1.x
:
Add the service provider to the providers
array in config/app.php
:
Then publish the config file:
Next, configure your BearyChat clients by editing the config file in app/config/packages/elfsundae/laravel-bearychat/config.php
.
Lumen
Register the service provider in bootstrap/app.php
:
Then copy the config file from this package to your app's config/bearychat.php
:
Now you can configure your BearyChat clients by editing config/bearychat.php
.
Usage
Basic Usage
You can obtain the BearyChat Client
using the BearyChat
facade, or the bearychat()
helper function.
You may access various clients via the client
method of the BearyChat
facade, or pass a client name to the bearychat()
function. The name should correspond to one of the clients listed in your BearyChat configuration file.
For more advanced usage, please read the documentation of the BearyChat PHP package.
Asynchronous Message
Sending a BearyChat message actually requests the Incoming Webhook via synchronous HTTP, so it will slow down your app execution. For sending asynchronous messages, You can queue them using Laravel's awesome queue system.
Here is an example of the Queueable Job for Laravel 5.3:
Then you can dispatch SendBearyChat
jobs by calling the dispatch
method on any object which includes the DispatchesJobs
trait, or just use the dispatch()
global function:
Sending Laravel Exceptions
A common usage of BearyChat is real-time reporting Laravel exceptions. Just override the report
method of your exception handler:
Creating Outgoing Responses
Need to respond to an Outgoing Robot? Simply create a JSON response with a Message
instance.
You may exclude your Outgoing handler from Laravel's CSRF protection.
Customize Guzzle
You can customize Guzzle HTTP clients for BearyChat by calling the customHttpClient
method on the BearyChat
facade or app('bearychat')
.
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
License
The BearyChat Laravel package is available under the MIT license.
All versions of laravel-bearychat with dependencies
illuminate/support Version ~5.0|~6.0|~7.0|~8.0
elfsundae/bearychat Version ^1.3.1