rlwebdiensten / laravel-viper
Viper365 API client wrapper for Laravel
Fund package maintenance!
rlwebdiensten
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.4
- illuminate/contracts: ^8.0|^9.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- pestphp/pest-plugin-mock: ^1.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-11-09 23:58:37 UTC
README
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.