A simple Viper365 API client wrapper for Laravel.
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();
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();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.