Still in development.
Laravel Vend is a Laravel package to help communicate with the Vend ePOS API. This package currently only has support for three resource types from Vend:
- Customers
- Products
- Sales
If you need any others, feel free to create a pull request.
- Install via Composer
composer require steadfastcollective/laravel-vend
- Publish Vend configuration file
php artisan vendor:publish --tag="vend-config"
During install, a vend.php
configuration file is published to your application's config
directory.
<?php
return [
/**
* Authentication
*
* You'll need your Vend domain prefix and a personal access
* token in order to authenticate with the Vend API.
*/
'domain_prefix' => env('VEND_DOMAIN_PREFIX'),
'personal_token' => env('VEND_API_TOKEN'),
/**
* Pagination
*
* Control the pagination limits when making requests with
* the Laravel Vend package.
*/
'page_size' => 75,
];
Here's a brief breakdown of each config option:
domain_prefix
- Each Vend instance has its own subdomain, which we refer to as a domain prefix. For example if your Vend URL issteadfastcollective.vendhq.com
then your domain prefix will besteadfastcollective
.personal_token
should be a Personal Access Token created in the Vend system.page_size
determines the amount of items that should be returned by the Vend API per request.
Below is an example of fetching the customers index, you could of course use this same code for any of the resources with an index
method. The index
method requires for an array of parameters to be passed in, this can be empty if you don't wish to use any parameters.
use SteadfastCollective\LaravelVend\Repositories\CustomerRepository;
// Let's return our store's customers
return CustomerRepository::index([]);
Regarding pagination, you need to provide the after
parameter and give it the version.max
value from the last request.
- Rate limiting, deal with it https://docs.vendhq.com/reference/introduction/rate-limiting
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.