PHPackages                             iz5clj/laravel-multi-theme - 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. [Templating &amp; Views](/categories/templating)
4. /
5. iz5clj/laravel-multi-theme

ActiveLibrary[Templating &amp; Views](/categories/templating)

iz5clj/laravel-multi-theme
==========================

A Laravel package for multi-theme support with dynamic view path switching

v1.0.4(4mo ago)03MITPHPPHP ^8.2

Since Dec 26Pushed 4mo agoCompare

[ Source](https://github.com/iz5clj/laravel-multi-theme)[ Packagist](https://packagist.org/packages/iz5clj/laravel-multi-theme)[ RSS](/packages/iz5clj-laravel-multi-theme/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Theme
=============

[](#laravel-theme)

A Laravel package for multi-theme support with dynamic view path switching.

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

[](#installation)

### Via Composer (from Packagist after publishing)

[](#via-composer-from-packagist-after-publishing)

```
composer require iz5clj/laravel-theme
```

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

[](#configuration)

Publish the configuration file:

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

This will create a `config/theme.php` file where you can set:

- `default` - The default theme name
- `path` - The base path where themes are located

Theme Structure
---------------

[](#theme-structure)

Create your themes in the configured path (default: `resources/themes`):

```
resources/themes/
├── my-theme/
│   └── views/
│       ├── welcome.blade.php
│       └── layouts/
│           └── app.blade.php
└── another-theme/
    └── views/
        └── welcome.blade.php

```

Usage
-----

[](#usage)

### Via Middleware (Recommended)

[](#via-middleware-recommended)

Apply the `theme` middleware to routes or route groups:

```
// Single route
Route::get('/', function () {
    return view('welcome');
})->middleware('theme:my-theme');

// Route group
Route::middleware(['theme:my-theme'])->group(function () {
    Route::get('/', function () {
        return view('welcome');
    });

    Route::get('/about', function () {
        return view('about');
    });
});
```

### Via Facade

[](#via-facade)

```
use Michel\LaravelTheme\Facades\Theme;

// Set the theme
Theme::set('my-theme');

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

// Get theme asset URL
$cssUrl = Theme::asset('css/app.css');
// Returns: /themes/my-theme/css/app.css

// Check if a theme exists
if (Theme::exists('my-theme')) {
    // ...
}

// Get all available themes
$themes = Theme::all();
```

### In Blade Templates

[](#in-blade-templates)

The current theme name is shared with all views as `$currentTheme`:

```

{{-- Or using the Theme facade --}}

```

### Theme Assets

[](#theme-assets)

Place your theme assets in the public directory:

```
public/themes/
├── my-theme/
│   ├── css/
│   │   └── app.css
│   ├── js/
│   │   └── app.js
│   └── images/
│       └── logo.png
└── another-theme/
    └── css/
        └── app.css

```

API Reference
-------------

[](#api-reference)

### ThemeService Methods

[](#themeservice-methods)

MethodDescription`set(string $theme)`Set the active theme`get()`Get the current theme name`asset(string $path)`Generate URL for theme asset`exists(string $theme)`Check if a theme exists`all()`Get all available themes`getThemePath(string $theme = null)`Get the full path to a theme's views`getBasePath()`Get the base themes path`setBasePath(string $path)`Set the base themes pathEnvironment Variables
---------------------

[](#environment-variables)

VariableDescriptionDefault`THEME_DEFAULT`The default theme name`default`License
-------

[](#license)

MIT License

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance75

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~1 days

Total

3

Last Release

135d ago

PHP version history (2 changes)v1.0.1PHP ^8.1|^8.2|^8.3|^8.4

v1.0.3PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/09227b2f6f1366f1f45bd4e59240113641a068a2192487a41f6174efd6d9d7c2?d=identicon)[iz5clj](/maintainers/iz5clj)

---

Top Contributors

[![iz5clj](https://avatars.githubusercontent.com/u/2203676?v=4)](https://github.com/iz5clj "iz5clj (8 commits)")

---

Tags

laravelthemeviewsmulti-theme

### Embed Badge

![Health badge](/badges/iz5clj-laravel-multi-theme/health.svg)

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

###  Alternatives

[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[karlomikus/theme

Add theming support to your Laravel 5.\* projects

704.4k](/packages/karlomikus-theme)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

252.7k](/packages/cornford-bootstrapper)

PHPackages © 2026

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