Skip to content

subvitamine/laravel-a-ray

Repository files navigation

Laravel A-ray

Latest Version Total Downloads

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages