subvitamine / laravel-a-ray
Package laravel for create push to a-ray
1.0.9
2022-11-10 11:03 UTC
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0|^9.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
This package assist create push on a-ray from laravel.
Installation
You can install the package via composer:
composer require subvitamine/laravel-a-ray
Usage
Add on your .env file
A_RAY_ENABLED=true#default true A_RAY_PRIVATE_KEY=pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A_RAY_NOTIFY_ERRORS_ENABLED=true#default false A_RAY_NOTIFY_CHANNEL=slack#default slack
Use on your code
use Subvitamine\LaravelARay\ARay; use Subvitamine\LaravelARay\CommitStatus; // Check config ARay::checkConfig() // Init push $push = ARay::initPush() /** * Add a commit status * All status : * SUCCESS * INFO * WARNING * ERROR */ $push->addCommit('commit message', ['commit' => 'data'], CommitStatus::SUCCESS) // Send push ARay::sendPush($push)
Handle errors
For handle errors, add this code in your App\Exceptions\Handler.php
use Subvitamine\LaravelARay\ARay; //... public function register() { $this->reportable(function (Throwable $e) { ARay::handleErrors($e); //... }); } //...
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.