rlwebdiensten/laravel-viper

Viper365 API client wrapper for Laravel

1.0.6 2022-04-20 12:50 UTC

README

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

A simple Viper365 API client wrapper for Laravel.

Installation

You can install the package via composer:

composer require rlwebdiensten/laravel-viper

These are the available ENV variables:

VIPER_API_ENDPOINT="" // Not required - default "basic-api.viper365.nl"
VIPER_API_TOKEN=""    // Required

After you have set the VIPER_API_TOKEN you can login with:

php artisan viper:login

Next you need to schedule the refresh command so the accessToken is refreshed every half hour:

php artisan viper:refresh

You can put the above command in your cronjob or schedule it with Laravel:

$schedule->command('viper:refresh')->everyFiveMinutes();

Usage

Using dependency injection

function __construct(\RlWebdiensten\LaravelViper\LaravelViper $viperService)
{
    $this->viperService = $viperService;

    // e.g.
    $persons = $this->viperService->getAllPersons();
}

Using the facade

function someMethod()
{
    $persons = LaravelViper::getAllPersons();
}

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.