Skip to content

A laravel package to easily interact with your red-amber.green monitors

License

Notifications You must be signed in to change notification settings

otrsw/rag-laravel

Repository files navigation

Laravel package to easily interact with your red-amber.green monitors

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

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/rag-laravel

You can publish the config file with:

php artisan vendor:publish --provider="Ontherocksoftware\RagLaravel\RagLaravelServiceProvider" --tag="rag-laravel-config"

This is the contents of the published config file:

return [

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

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

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

];

Usage

use Ontherocksoftware\RagLaravel\RagLaravel;

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


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

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

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

Testing

composer test

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

About

A laravel package to easily interact with your red-amber.green monitors

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages