›
›
›
  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

Installation and setup.

Install the package and choose config or database storage for brand definitions.

Install Laravel Whitelabel in an application that serves more than one brand. The package requires PHP 8.3 or later and Laravel 12 or 13.

1. Install the package

composer require byrcsc/laravel-whitelabel

Laravel package discovery registers the service provider. You do not need to add it to bootstrap/providers.php.

2. Publish the configuration

php artisan whitelabel:install

The command publishes config/whitelabel.php. In an interactive terminal it asks whether to publish the database migration. The default answer keeps brands in configuration.

Use --force to replace an existing published config file:

php artisan whitelabel:install --force

Review local changes before keeping an overwritten config file.

3. Choose a storage driver

Keep the default driver when brands change with application code:

'driver' => 'config',

For runtime writes, publish the migration without an interactive prompt:

php artisan whitelabel:install --database
php artisan migrate

Then change the driver:

'driver' => 'database',

The migration reads whitelabel.database.connection and whitelabel.database.table when it runs. Set those values before migration if the brands table belongs on another connection or needs another name.

4. Define the default brand

The config driver requires the identifier in whitelabel.default to exist when at least one brand is configured:

'default' => 'default',

'brands' => [
    'default' => [
        'name' => 'Example',
        'logo' => 'brands/default/logo.svg',
        'colors' => ['primary' => '#111827'],
    ],
],

When the config driver's default brand omits name, the package uses app.name. The database driver does not apply that package default, so store a name if the database-backed default brand needs one.

Published assets

The service provider exposes three publish tags:

TagDestination
whitelabel-configconfig/whitelabel.php
whitelabel-migrationsdatabase/migrations/*_create_whitelabel_brands_table.php
whitelabel-viewsresources/views/vendor/whitelabel

Publish views only when you need to change the component markup:

php artisan vendor:publish --tag=whitelabel-views

Published views override the package views and become application code that you must maintain.

What to read next

  • Quick start to define two brands and render the active one.
  • Brand definitions for the accepted fields and value shapes.
  • Manage database brands to create and update brands at runtime.
PreviousIntroductionNextQuick start
View source

On this page

  1. 1. Install the package
  2. 2. Publish the configuration
  3. 3. Choose a storage driver
  4. 4. Define the default brand
  5. Published assets
  6. What to read next