PHPackages                             bahae/laravel-theme-switcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bahae/laravel-theme-switcher

ActiveLibrary[Framework](/categories/framework)

bahae/laravel-theme-switcher
============================

A Laravel package for dynamic theme switching with beautiful color palettes

v1.8.0(1y ago)110MITBladePHP ^8.1

Since May 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/bahaeddinOs56/Laravel-theme-switcher)[ Packagist](https://packagist.org/packages/bahae/laravel-theme-switcher)[ RSS](/packages/bahae-laravel-theme-switcher/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (12)Used By (0)

Laravel Theme Switcher
======================

[](#laravel-theme-switcher)

A powerful and flexible theme management system for Laravel applications. This package provides a complete solution for managing themes, including theme switching, customization, presets, and analytics.

Features
--------

[](#features)

- 🎨 Multiple theme support
- 🎯 Theme preview functionality
- 🛠️ Theme customization interface
- 💾 Theme presets management
- 📊 Theme usage analytics
- 🔄 Theme export/import
- 🌙 Dark/Light mode support
- 📱 Responsive design
- 🎯 Premium themes support

Installation
------------

[](#installation)

```
composer require bahaeddin/laravel-theme-switcher
```

Publish the configuration and assets:

```
php artisan vendor:publish --tag=theme-switcher-config
php artisan vendor:publish --tag=theme-switcher
php artisan vendor:publish --tag=theme-switcher-migrations
```

Run the migrations:

```
php artisan migrate
```

Configuration
-------------

[](#configuration)

The package configuration file (`config/themes.php`) allows you to customize various aspects of the theme system:

```
return [
    'default_theme' => 'light',
    'themes' => [
        'light' => [
            'name' => 'Light Theme',
            'colors' => [
                'primary' => '#007bff',
                'secondary' => '#6c757d',
                // ... other colors
            ],
            // ... other settings
        ],
        'dark' => [
            'name' => 'Dark Theme',
            'colors' => [
                'primary' => '#0d6efd',
                'secondary' => '#adb5bd',
                // ... other colors
            ],
            // ... other settings
        ],
    ],
];
```

Usage
-----

[](#usage)

### Basic Theme Switching

[](#basic-theme-switching)

```
use Bahae\LaravelThemeSwitcher\Theme;

// Switch to a theme
Theme::setTheme('dark');

// Get current theme
$currentTheme = Theme::getCurrentTheme();

// Get theme settings
$settings = Theme::getCurrentSettings();
```

### Theme Preview

[](#theme-preview)

Visit `/theme-switcher/preview` to see the theme preview interface. This allows users to:

- Preview themes before applying
- See live changes
- Compare different themes
- Apply themes with one click

### Theme Customization

[](#theme-customization)

Visit `/theme-switcher/customize` to access the theme customizer. Features include:

- Color picker for theme colors
- Typography settings
- Shadow and border controls
- Live preview
- Save custom themes

### Theme Presets

[](#theme-presets)

Visit `/theme-switcher/presets` to manage theme presets. Features include:

- Save current theme configuration as a preset
- Apply saved presets
- Manage public and private presets
- Delete custom presets

```
use Bahae\LaravelThemeSwitcher\ThemePreset;

// Create a preset from current theme
ThemePreset::createFromCurrent(
    'My Preset',
    'A custom theme configuration',
    true, // is public
    Auth::id() // user ID
);

// Get public presets
$publicPresets = ThemePreset::getPublicPresets('light');

// Get user presets
$userPresets = ThemePreset::getUserPresets('light', Auth::id());
```

### Theme Analytics

[](#theme-analytics)

Visit `/theme-switcher/analytics` to view theme usage statistics. Features include:

- Theme switch tracking
- Usage statistics
- Trend analysis
- User preferences

```
use Bahae\LaravelThemeSwitcher\ThemeAnalytics;

// Track a theme switch
ThemeAnalytics::trackSwitch('dark');

// Get theme statistics
$stats = ThemeAnalytics::getThemeStats('dark');

// Get theme trends
$trends = ThemeAnalytics::getThemeTrends('dark');
```

### Export/Import Themes

[](#exportimport-themes)

```
use Bahae\LaravelThemeSwitcher\Theme;

// Export a theme
$themeData = Theme::exportTheme('dark');

// Import a theme
Theme::importTheme($themeData);
```

Blade Components
----------------

[](#blade-components)

The package includes several Blade components for easy integration:

```
{{-- Theme Switcher --}}

{{-- Theme Preview --}}

{{-- Theme Customizer --}}

{{-- Theme Analytics --}}

```

JavaScript API
--------------

[](#javascript-api)

The package provides a JavaScript API for theme management:

```
// Initialize theme switcher
const themeSwitcher = new ThemeSwitcher();
themeSwitcher.init();

// Switch theme
themeSwitcher.switchTheme('dark');

// Get current theme
const currentTheme = themeSwitcher.getCurrentTheme();

// Save preset
themeSwitcher.savePreset({
    name: 'My Preset',
    description: 'A custom theme',
    isPublic: true
});
```

Events
------

[](#events)

The package fires several events that you can listen to:

```
// Theme switched
ThemeSwitched::class

// Theme customized
ThemeCustomized::class

// Preset created
PresetCreated::class

// Preset applied
PresetApplied::class
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

Support
-------

[](#support)

For support, please open an issue on GitHub or contact the maintainers.

Changelog
---------

[](#changelog)

### v1.8.0

[](#v180)

- Added theme presets functionality
- Added theme analytics
- Enhanced theme customization
- Improved UI/UX

### v1.7.0

[](#v170)

- Added theme preview
- Added theme customization
- Enhanced theme switching

### v1.6.0

[](#v160)

- Added premium themes
- Enhanced theme system
- Improved performance

[View full changelog](CHANGELOG.md)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance46

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

11

Last Release

416d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/141367681?v=4)[Bahae](/maintainers/bahaeddinOs56)[@bahaeddinOs56](https://github.com/bahaeddinOs56)

---

Tags

frameworklaravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bahae-laravel-theme-switcher/health.svg)

```
[![Health](https://phpackages.com/badges/bahae-laravel-theme-switcher/health.svg)](https://phpackages.com/packages/bahae-laravel-theme-switcher)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3891.8k](/packages/codewithdennis-larament)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[nunomaduro/laravel-starter-kit-inertia-react

The skeleton application for the Laravel framework.

2071.1k](/packages/nunomaduro-laravel-starter-kit-inertia-react)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

461.7k](/packages/ercogx-laravel-filament-starter-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
