rishadblack / sylloo-pos-core
The shared core of the Sylloo POS tills (PC and Android): the till's models and migrations, the money rules, the sync jobs with the ERP, the receipt layouts and data, the texts and the till's parts of the shared device screens. No screen, no platform: each till answers its contracts.
Requires
- php: ^8.3
- laravel/framework: ^12.0|^13.0
- rishadblack/larahelpers: ^2.0
- rishadblack/sylloo-app-base: ^1.2
- spatie/laravel-translatable: ^6.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.20
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0|^5.0
- pestphp/pest-plugin-laravel: ^4.0|^5.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
rishadblack/sylloo-pos-core is the shared core of the Sylloo POS tills: the PC till (NativePHP Desktop) today and the
Android till (NativePHP Mobile) next. It holds what a till does, and nothing of how a platform shows or stores it:
- the till's models, casts and all its migrations (same tables and columns as before), seeders and factories;
- the services: pricing, stock, cart and order totals, payments and cash rounding, shifts and cash drawer, returns,
due collection, customer credit, kitchen tickets, table bills, backups, retention, the ERP calls (
ApiService,ErpApiService), sync status and errors, the ERP-ordered reset, the local data reset, the release steps; - the sync jobs (pull, push, heartbeat, images, staff, terminal profile, remote config);
- the receipt layouts (
sylloo-pos-core::receipts.*) and the receipt data, rendered to one self-contained HTML page; - the texts in English and Bangla (
__('device.…'), and the till's words on the shared base's screens); - the decisions of the till's shared screens (
Screens\TillScreens): the "almost ready" state, the fresh start on a new activation code, the sign-in step.
It builds on rishadblack/sylloo-app-base and answers the base's
till contracts itself (device state, the cashiers as members, the release steps).
Install
composer require rishadblack/sylloo-pos-core php artisan migrate
Bind the platform
Everything a platform does is a contract. Unbound, the defaults keep settings in memory and print, show and start nothing. A till binds its own in a service provider:
$this->app->singleton(TillSettings::class, NativeTillSettings::class); // key/value of the till $this->app->singleton(QueueWorkers::class, NativeQueueWorkers::class); // start and stop a queue worker $this->app->bind(ReceiptPrinter::class, ElectronReceiptPrinter::class); // print one HTML page, list printers $this->app->bind(CustomerDisplayScreen::class, ElectronCustomerDisplay::class); // the customer's screen
and the base's own: DeviceStore, Notifier, AppUpdater, BrowserOpener, SecretStore, LockSource.
The shared screens take the till's parts with one call, the till giving its face (sign in, a notice on the next page, its own pieces):
Rishadblack\SyllooPosCore\Screens\TillScreens::register($hooks, $states, new MyTillScreenFace);
Config (php artisan vendor:publish --tag=sylloo-pos-core-config): migrations (load the till's migrations) and
reset.storage_folders (the till's own folders under storage/ that a fresh start removes).
Rules
- No Livewire, Electron, NativePHP, session, request or HTML builder in
src/: plain values in and out. - Receipts are self-contained: nothing loads from the network.
- Every sentence in English and Bangla.
- The table and column names, and the push/pull contract with the ERP, change only with a note in the changelog.
Testing
composer test # Pest composer analyse # PHPStan level 6 composer lint # Pint
License
MIT. See license.md.