›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-whitelabel
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Brand definitions
  • Fallback and clearing
  • Brand resolution
  • Brand repositories

Using brands

  • Blade components
  • Mail and notifications
  • Queues
  • Spatie Multitenancy

Operations

  • Manage database brands
  • Custom drivers and resolvers
  • Events and listeners
  • Cache management

Reference

  • Configuration
  • Public API
  • Console commands
  • Testing
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Brand definitions
  • Fallback and clearing
  • Brand resolution
  • Brand repositories

Using brands

  • Blade components
  • Mail and notifications
  • Queues
  • Spatie Multitenancy

Operations

  • Manage database brands
  • Custom drivers and resolvers
  • Events and listeners
  • Cache management

Reference

  • Configuration
  • Public API
  • Console commands
  • Testing
  • Troubleshooting

byrcsc/laravel-whitelabel · 1.x

Introduction.

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.

What a brand contains

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.

Where brands come from

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.

Where the active brand goes

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.

What it does not do

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.

What to read next

  • Installation and setup to install the package and publish its configuration.
  • Quick start to serve two brands from different hosts.
  • Brand resolution to understand how the active brand is selected and retained.
NextInstallation and setup
View source

On this page

  1. What a brand contains
  2. Where brands come from
  3. Where the active brand goes
  4. What it does not do
  5. What to read next