›
byrcsc/laravel-whitelabel · 1.x
Give each white-label client its own assets, colours, mail sender, and application settings.
A white-label application needs the same client configuration in views, mail, notifications, and queued jobs. If each part selects a client independently, logos, colours, senders, and settings can diverge. Laravel Whitelabel stores these values as a brand and selects one active brand for each request or job.
<x-whitelabel::favicon />
<x-whitelabel::styles />
<x-whitelabel::logo class="h-8" />
<h1>Welcome to {{ brand('name') }}</h1>The request host can select the brand, or you can activate one directly. Laravel Whitelabel also integrates with Spatie Laravel Multitenancy, so the current tenant can provide the active brand. Resolvers run in their configured order. The first brand returned stays active for later reads.
A brand has an identifier and an immutable definition. The fixed fields are a
display name, domain, logo, favicon, colours, and mail sender. The settings
bag holds application-specific values that do not belong in the fixed schema.
Each non-default brand inherits omitted values from the default brand. This keeps shared assets and settings in one place while allowing a brand to replace or clear individual values.
The default config driver reads definitions from config/whitelabel.php. It
fits applications whose brands change through deployment.
The database driver stores definitions in a published table and lets you
create, update, and delete brands while the application is running. Choose it
when brands change through an admin UI or another application workflow.
Database reads are cached by default.
The package exposes the active brand through the Whitelabel facade, the
brand() helper, and optional Blade components. Laravel Markdown mail can use
the brand logo and primary colour. Sender overrides are available but disabled
until you opt in.
Queued jobs, mailables, notifications, and listeners can use the BrandAware
trait to restore the brand that was active at dispatch. Long-lived workers and
Octane processes flush active state between units of work.
The package does not upload assets, check whether an asset exists, or make a Storage disk public. It builds URLs from definitions you provide.
It does not provide an admin interface, tenant model, domain verification, or mail DNS setup. It also treats brand definitions as trusted developer or operator input, not untrusted customer input.