king-of-web-designs / laravel-xpos
This package connects the Xpos till system to a laravel application via the Xpos API
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
This package is auto-updated.
Last update: 2025-08-17 18:30:55 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
King Of Web Designs
Installation
You can install the package via composer:
composer require king-of-web-designs/laravel-xpos
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-xpos-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-xpos-config"
This is the contents of the published config file:
return [
];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-xpos-views"
Usage
Basic usage. Add the use statement at the top of your controller or wherever you wish to use the packge. Then call the function along with call function required (listed below) to return an array of that data.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; public function useLaravelXpos() { $Xpos = new LaravelXpos(); return $Xpos->sales(); }
In your .env file include the variables XPOS_TEST_API_KEY and XPOS_URL. A future release will add a test mode and a live test key & url.
Please contact XPOS directly for your shop API URL and API Key.
XPOS_TEST_API_KEY="YOUR API KEY" XPOS_URL="YOUR URL"
Brands (GET)
Returns an array of the brands used by the shop.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $Xpos = new LaravelXpos(); $Xpos->brands();
Groups (GET)
Returns an array for the Groups used by the shop. Groups are held in a 3 tier structure. Where ParentGroupID is null, the group is a root. It can have any number of child groups beneath it where the ParentGroupID of another group equals the GroupID of the root node. These children are linked to other groups in the same way.
Root Nodes are known as “Departments“ in Xpos cloud. Their children are “Product Groups” and the grand children are “Sub Groups”. Products are only ever linked to Sub Groups via the GroupID property in products.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $Xpos = new LaravelXpos(); $Xpos->groups();
Customer (GET) - requires: customerid
Returns a specific customer record based on the customer id given. Cannot access 'Internal' customers.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $customerID = '1234'; //Get your customer id here. $Xpos = new LaravelXpos(); $Xpos->customer($customerID);
Customers (GET) - requires: page number (default = 1)
Returns an array customers in pages of 25 records. Cannot access ‘Internal’ customers.
Pass the page number and a date to return further pages and customers based on the the 'Last Adjusted Date' field. The date passed will return records before this date.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $pageNo = '1'; //Get your customer id here. $dateTime = '2025-02-10 11:46:37.933'; $Xpos = new LaravelXpos(); $Xpos->customers($pageNo, $dateTime);
Inventory (GET) - BROKEN:TO BE FIXED - requires: page number (default = 1)
Returns an array of stock levels for matching products in the shop in pages of 25.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $pageNo = '1'; //Get your customer id here. $Xpos = new LaravelXpos(); $Xpos->inventory($pageNo);
Products (GET) - requires: page number (default = 1)
Returns an array of products stock in the shop in pages of 25.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $pageNo = '1'; //Get your customer id here. $Xpos = new LaravelXpos(); $Xpos->products($pageNo);
Sales (GET) - requires: page number (default = 1)
Returns an array of all sales since a specific date. Only returns completed sales
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $pageNo = '1'; //Get your customer id here. $dateTime = '2025-02-10 11:46:37.933'; $Xpos = new LaravelXpos(); $Xpos->sales($pageNo, $dateTime);
Staff (GET)
Returns an array of the staff in the shop.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $Xpos = new LaravelXpos(); $Xpos->staff();
VatRates (GET)
Returns an array of current VAT Rates in shop.
use KingOfWebDesigns\LaravelXpos\LaravelXpos; $Xpos = new LaravelXpos(); $Xpos->vatRates();
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.