buzztech / boi-backend
BOI Laravel backend package
Requires
- php: ^8.2
- brick/math: ^0.12|^0.13|^0.14|^0.15|^0.16|^0.17
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/filesystem: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- phpunit/phpunit: ^11.0 <11.5.51
README
Composer package shared by BOI Laravel apps (Glow, portals, …).
Full integration guide: see doc/README.md (package vs app, database connection, shared models, Nova & policies).
boi-api HTTP proxy (plug & play)
Forwards browser calls to your app’s /api/boi-api/{path} to BOI_API_URL with server-only BOI_API_KEY and headers X-Boi-User / X-Boi-App.
composer require buzztech/boi-backend(already auto-discoversBoiBackendServiceProvider).- Set
.env:BOI_API_URL,BOI_API_KEY,BOI_APP(slug, e.g.glow), optionalBOI_USER_HEADER/BOI_APP_HEADER. - In
routes/web.php(inside yourauth+verifiedgroup):
use Boi\Backend\BoiBackend; BoiBackend::proxyRoute();
- Loan applications: for paths
api/loan-applications/{id}/…, the proxy checksApp\Models\Applicationexists anduser_idmatches the logged-in user (same convention for all BOI apps).
Publish full defaults: php artisan vendor:publish --tag=boi-backend-proxy
Other features
- Contracts:
StatementDataProviderInterface,StatementUpdaterInterface(implemented by the deployed boi-api service or tests). - PaystackBanks (
Boi\Backend\Support\PaystackBanks): sync bank list + short names into yourBankmodel (used by seeders). Boi\Backend\Models\Bank:bankson connectionboi_api(BOI_DB_*). boi-api can keepApp\Models\Bankviaconfig/banks.php.
EDOC / bank-statement API live in boi-api.
Installation
composer require buzztech/boi-backend
Optional publish tags: boi-backend-config (banks.php), boi-backend-boi-api (boi_api.php), boi-backend-proxy (boi_proxy.php).
Laravel Nova, factories, seeders
See doc/ — Nova resources and Gate::policy are per app; factories/seeders live in the package.
Development
composer install
composer test
Releasing (buzztech/boi-backend)
-
Merge changes to
mainand ensurecomposer testpasses. -
Tag a semver release (Composer / Packagist use the tag, not a
versionfield incomposer.json):git tag v0.2.0 git push origin v0.2.0
-
Packagist (optional): submit
https://github.com/BuzzTechnics/boi-backendonce; future tags are picked up automatically. -
Consumers (e.g.
boi-api): require"buzztech/boi-backend": "^0.2@dev"whilemaintracks the next minor (@devallows the0.2.x-devalias; withprefer-stable, Composer prefers the latestv0.2.xtag). For stable-only installs after tags exist, use"^0.2". Add a VCS repository only if the package is not on Packagist:"repositories": [ { "type": "vcs", "url": "https://github.com/BuzzTechnics/boi-backend.git" } ]
If
../boi-backendexists as a sibling checkout, a path repository (as inboi-api) keeps local development on a symlinked copy.