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.

Maintainers

Package info

github.com/InvoiceShelf/modules

pkg:composer/invoiceshelf/modules

Statistics

Installs: 19 700

Dependents: 0

Suggesters: 0

Stars: 0

3.0.2 2026-04-11 10:51 UTC

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 their ServiceProvider::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.