Skip to content

Laravel package to easily update business KPI monitors for your software or service. Monitors can be exposed to your user community via mobile app or embedded into your own application.

License

Notifications You must be signed in to change notification settings

otrsw/laravelredambergreen

Repository files navigation

LaravelRedAmberGreen

Latest Version on Packagist Total Downloads GitHub Tests Action Status GitHub Code Style Action Status

Quick and simple way to expose realtime business KPIs of your system or software to your user community.

Installation

You can install the package via composer:

composer require ontherocksoftware/laravelredambergreen

You can publish the config file with:

php artisan vendor:publish --provider="Ontherocksoftware\LaravelRedAmberGreen\LaravelRedAmberGreenServiceProvider"

This is the contents of the published config file:

return [

    /**
     * Your API token. Obtain from your account at https://app.red-amber.green/
     */
    'token' => env('RAG_API_TOKEN','YOUR_TOKEN'),

    /**
     * If you prefer to use the service without exceptions, set this to false
     */

     'exceptions' => env('RAG_WITH_EXCEPTIONS',true)

];

Usage

use Ontherocksoftware\LaravelRedAmberGreen\Facades\LaravelRedAmberGreen;

/**
 * Assuming you added a monitor to your account named 'Stock Levels' you can interact with that monitor 
 * using the static methods provided:
 */ 


//Your code here to check stock levels....

//If all good just set to green
LaravelRedAmberGreen::green('Stock Levels');

//If you want to provide additional info you can pass a short message and a link to more in depth info
LaravelRedAmberGreen::amber('Stock Levels', 'Stock levels dropped significantly in the last 24 hours', 'https://www.mysystem.com/dashboard/stocklevels');

//And of course if things are already really bad use the red method
LaravelRedAmberGreen::red('Stock Levels', 'We ran out of stock for some products', 'https://www.mysystem.com/dashboard/outofstock');

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Laravel package to easily update business KPI monitors for your software or service. Monitors can be exposed to your user community via mobile app or embedded into your own application.

Resources

License

Stars

Watchers

Forks

Languages