Skip to content

Providers

Modularous ships with seven service providers. They form a strict registration hierarchy — the application only needs to register one entry point (ModularousProvider) and all others are booted in order.

Provider Hierarchy

ModularousProvider          ← register in config/app.php
├── GeoIPServiceProvider    (third-party)
├── TimezoneServiceProvider (third-party)
├── BaseServiceProvider     ← core bindings, macros, view composers
├── ModuleServiceProvider   ← per-module boot (migrations, routes, views, lang)
├── RouteServiceProvider    ← system & module routing, route macros
├── AuthServiceProvider     ← gates, Horizon auth, email verification
└── CoverageServiceProvider ← code coverage analysis service

ServiceProvider is the abstract base all internal providers extend. It is never registered directly.

Provider Reference

ProviderSourceResponsibility
ServiceProviderProviders/ServiceProvider.phpAbstract base — $baseKey, config merge strategy, publishable view paths
ModularousProviderProviders/ModularousProvider.phpEntry point — registers all other providers in order
BaseServiceProviderProviders/BaseServiceProvider.phpCore bindings, commands, macros, view composers, log channels, scheduler
ModuleServiceProviderProviders/ModuleServiceProvider.phpBoots every enabled nwidart module (migrations, views, lang, commands, providers)
RouteServiceProviderProviders/RouteServiceProvider.phpRegisters system routes, module routes, and route macros
AuthServiceProviderProviders/AuthServiceProvider.phpGates, Horizon access, custom email-verification URL/mail
TelescopeServiceProviderProviders/TelescopeServiceProvider.phpTelescope access control and entry filtering
CoverageServiceProviderProviders/CoverageServiceProvider.phpCode-coverage analysis bindings and commands

Registration

Add only the entry-point provider to your application:

php
// config/app.php
'providers' => [
    // ...
    Unusualify\Modularous\Providers\ModularousProvider::class,
],