invoiceshelf / modules
InvoiceShelf-specific extensions for nwidart/laravel-modules — registry for module-contributed sidebar items and settings schemas.
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Requires
- php: ^8.3
- nwidart/laravel-modules: ^13.0
Requires (Dev)
- laravel/pint: ^1.16
- orchestra/testbench: ^10.0
- phpunit/phpunit: ^12.0
This package is not auto-updated.
Last update: 2026-04-11 10:57:48 UTC
README
A thin extension package on top of nwidart/laravel-modules that adds an InvoiceShelf-specific registry for module-contributed sidebar entries and settings schemas.
What it provides
InvoiceShelf\Modules\Registry— a static registry that modules call from theirServiceProvider::boot()to declare:- A sidebar entry (title, link, icon) that the host app renders in the company sidebar's "Modules" group.
- A settings schema (sections of typed fields) that the host app renders generically as a form via
BaseSchemaForm.vue, with values stored per-company.
InvoiceShelf\Modules\Settings\Schema/FieldType— a value object + enum that lock down the supported field types (text,password,textarea,switch,number,select,multiselect) and validate the schema shape at registration time.
The actual module loading, file generation, migration, and provider registration are all handled by upstream nwidart/laravel-modules (required as a composer dependency).
Usage from inside a module
use InvoiceShelf\Modules\Registry; class SalesTaxUsServiceProvider extends ServiceProvider { public function boot(): void { Registry::registerMenu('sales-tax-us', [ 'title' => 'sales_tax_us::menu.title', 'link' => '/admin/modules/sales-tax-us/settings', 'icon' => 'CalculatorIcon', ]); Registry::registerSettings('sales-tax-us', [ 'sections' => [ [ 'title' => 'sales_tax_us::settings.connection', 'fields' => [ ['key' => 'api_key', 'type' => 'password', 'rules' => ['required']], ['key' => 'sandbox', 'type' => 'switch', 'default' => false], ], ], ], ]); } }
Because nwidart/laravel-modules only boots providers for currently-activated modules, the registry naturally only contains active modules at request time — no extra filtering needed.
License
MIT. See LICENSE.md.