Skip to content

BaseServiceProvider ​

Class: Unusualify\Modularous\Providers\BaseServiceProvider
Source: src/Providers/BaseServiceProvider.php
Extends: ServiceProvider

The core provider that handles all container bindings, macro registration, view composers, log channels, and the application scheduler. It is the heaviest provider in the stack and is registered by ModularousProvider.

register() ​

Helper files ​

All PHP files in src/Helpers/ are required in sequence so global helper functions are available globally.

Config merging ​

SourceMerged into
config/config.phpmodularous.*
config/merges/*.phpmodularous.{filename}.*
config/disks.phpfilesystems.disks.*

Container bindings (singletons) ​

Binding keyClassDescription
RepositoryInterfaceModularousOverrides nwidart's LaravelFileRepository with the Modularous-extended implementation
modularousalias for ModularousConvenience alias
modularous.navigationModularousNavigationAdmin navigation service
model.relation.namespace—Eloquent relations namespace string
model.relation.pattern—Regex pattern derived from relation namespace
unusualify.hostingHostRoutingHost-based routing helper
unusualify.hostRoutingHostRouteRegistrarHost-based route registrar
FilepondFilepondManagerFilepond upload manager
currency.exchangeCurrencyExchangeServiceCurrency exchange rates
CurrencyProviderInterfaceResolved at runtimeUses modularous.currency_provider config; falls back to SystemPricingCurrencyProvider then NullCurrencyProvider
modularous.relationship.graphCacheRelationshipGraphRelationship dependency graph for cache invalidation
modularous.cacheModularousCacheServicePackage-level cache service
migration.backupMigrationBackupMigration backup utility
modularous.redirectRedirectServiceRedirect management
modularous.utmUtmParametersUTM parameter tracking
auth.registerRegisterBrokerManagerAuth registration broker
inertia.middlewareHandleInertiaRequestsInertia request handler

Aliases ​

AliasClass
ModularousViteFacades\ModularousVite
GeoIPTorann\GeoIP\Facades\GeoIP

Translation service ​

Extends Laravel's translation.loader with a multi-path FileLoader that searches:

  1. vendor/laravel/framework/.../Translation/lang
  2. Package lang/
  3. Application lang/ (when not overridden by modularous/lang/)
  4. app['path.lang']

Extends translator with a custom Translator instance that reads from these paths in order.

boot() ​

Auth config validation ​

When enabled.users-management is on and not running in console, validates that the Modularous auth guard, provider, and password config all exist in config/auth. Throws AuthConfigurationException with a descriptive message if any are missing.

Media and file service singletons ​

ConditionBinding
enabled.media-library = trueimageService → class from media_library.image_service config
enabled.file-library = truefileService → class from file_library.file_service config

Local disk URL is auto-configured when endpoint type is local and disk matches the package default.

Macros ​

MacroTargetDescription
Str::modularousSlug()Illuminate\Support\StrSlug with locale-aware dictionary from slug-dictionary translations
Collection::recursive()Illuminate\Support\CollectionRecursively converts all nested arrays/objects to Collections
Request::getCachedUserCurrency()Illuminate\Support\Facades\RequestReturns user's currency from session or the default pricing currency

View composers ​

Registered on '*' (all views) or specific layout views:

ComposerViewsCondition
Inline*Always — injects BASE_KEY, MODULAROUS_VIEW_NAMESPACE, SYSTEM_PACKAGE_VERSIONS
Urls*Always
CurrentUseradmin.*, {baseKey}::*enabled.users-management = true
MediasUploaderConfigmaster/app-inertia layoutsenabled.media-library = true
FilesUploaderConfigmaster/app-inertia layoutsenabled.file-library = true
Localizationmaster/auth/app-inertia layoutsAlways
Inline render flagsadmin.*, templates.*, {baseKey}::*Always — injects renderForBlocks, renderForModal

Scheduler ​

CommandSchedule
modularous:fileponds:scheduler --days=7Daily
telescope:prune --hours=168Daily (appends to logs/scheduler.log)
modularous:scheduler:chatableEvery minute

Log channels ​

ChannelDriverDescription
modularousmonolog with ModularousLogHandlerPackage debug log; retention 14 days; level from MODULAROUS_LOG_LEVEL env
modularous-notification-failuredailyNotification failure log; storage/logs/modularous-notification-failure.log; 14-day retention

Password reset URL ​

Overrides Laravel's default reset URL to point to admin.password.reset named route.

php artisan about ​

Adds a Modularous section to php artisan about output showing cache status, scan status, theme, URLs, vendor path, and version.