apsg / baselinker
Baselinker Integration
0.1.3
2022-04-27 16:58 UTC
Requires
- illuminate/support: ~5|~6|~7|~8|~9
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4|~5|~6
- phpunit/phpunit: ~8.0|~9.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-10-27 21:58:09 UTC
README
Laravel Baselinker API integration
Baselinker docs:
Installation
Jus use:
composer require apsg/baselinker
The package should be auto-discovered by Laravel.
After installation add the BASELINKER_TOKEN={your-token}
to your .env
file.
Usage
Use Baselinker
facade and use one of shortcut methods:
- products()
- categories()
- orders()
- storages()
Example:
use Apsg\Baselinker\Facades\Baselinker; $categories = Baselinker::categories()->getCategories();
Change default storage
Default storage is set to Baselinker's default bl_1
.
One can change the default storage globally by setting the BASELINKER_STORAGE
value in their env file.
To change the storage dynamically use the setStorage(...)
helper method on any baselinker support class.
Example:
use Apsg\Baselinker\Facades\Baselinker; $productsInOtherStorage = Baselinker::products()->setStorage('storage_id'); $products = $productsInOtherStorage->getProductsList(); $newProduct = $productsInOtherStorage->addProduct($someProductData);
Currently covered methods:
See baselinker docs for reference.
Storages:
getStoragesList
Categories:
addCategory
getCategories
Products:
addProduct
getProductsList
Orders:
addOrder
getOrderStatusList