PHPackages                             isaeken/laravel-theme-system - 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. isaeken/laravel-theme-system

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

isaeken/laravel-theme-system
============================

Theme system for Laravel

v2.4(4y ago)70278MITPHPPHP ^8.0

Since Sep 29Pushed 3y ago2 watchersCompare

[ Source](https://github.com/isaeken/laravel-theme-system)[ Packagist](https://packagist.org/packages/isaeken/laravel-theme-system)[ Docs](https://github.com/isaeken/laravel-theme-system)[ GitHub Sponsors](https://github.com/isaeken)[ RSS](/packages/isaeken-laravel-theme-system/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (9)Versions (7)Used By (0)

Laravel Theme System
====================

[](#laravel-theme-system)

[![Laravel Theme System](https://camo.githubusercontent.com/cb016e693162ef2471f50cfd8c338e887585feeb3369a1e627a9c9c60eb44a55/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305468656d6525323053797374656d2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f73657225323072657175697265267061636b6167654e616d653d697361656b656e2f6c61726176656c2d7468656d652d73797374656d267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4d616b652532306d756c7469706c652532307468656d6573253230666f72253230796f75722532304c61726176656c2532306170706c69636174696f6e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470733a2f2f6c61726176656c2e636f6d2f696d672f6c6f676f6d61726b2e6d696e2e737667)](https://camo.githubusercontent.com/cb016e693162ef2471f50cfd8c338e887585feeb3369a1e627a9c9c60eb44a55/68747470733a2f2f62616e6e6572732e6265796f6e64636f2e64652f4c61726176656c2532305468656d6525323053797374656d2e706e673f7468656d653d6c69676874267061636b6167654d616e616765723d636f6d706f73657225323072657175697265267061636b6167654e616d653d697361656b656e2f6c61726176656c2d7468656d652d73797374656d267061747465726e3d617263686974656374267374796c653d7374796c655f31266465736372697074696f6e3d4d616b652532306d756c7469706c652532307468656d6573253230666f72253230796f75722532304c61726176656c2532306170706c69636174696f6e266d643d312673686f7757617465726d61726b3d3126666f6e7453697a653d313030707826696d616765733d68747470733a2f2f6c61726176656c2e636f6d2f696d672f6c6f676f6d61726b2e6d696e2e737667)

[![Latest Version](https://camo.githubusercontent.com/7b8a0f760968eae9a2dc264164acab35e7240a11a75d548eea924cae1143e011/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f697361656b656e2f6c61726176656c2d7468656d652d73797374656d3f736f72743d73656d766572266c6162656c3d76657273696f6e)](https://packagist.org/packages/isaeken/laravel-theme-system)[![CircleCI](https://camo.githubusercontent.com/97e414302a8dc60d886184d9893a5c71d3e9927601be9a59accbfbd1960346e7/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f6769746875622f697361656b656e2f6c61726176656c2d7468656d652d73797374656d)](https://camo.githubusercontent.com/97e414302a8dc60d886184d9893a5c71d3e9927601be9a59accbfbd1960346e7/68747470733a2f2f696d672e736869656c64732e696f2f636972636c6563692f6275696c642f6769746875622f697361656b656e2f6c61726176656c2d7468656d652d73797374656d)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/940eddd0576bb42892c78430e97036ea1c98314544ca6ff004e25f5473af9344/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f697361656b656e2f6c61726176656c2d7468656d652d73797374656d2f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/isaeken/laravel-theme-system/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/26d07b311961c482a063227d4b4fce24d3b0bc115bb7333e923734a53dff32be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f697361656b656e2f6c61726176656c2d7468656d652d73797374656d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/isaeken/laravel-theme-system)

Installation and setup
----------------------

[](#installation-and-setup)

### Installation

[](#installation)

You can install the package via composer:

```
composer require isaeken/laravel-theme-system
```

### Setup

[](#setup)

You can publish the config file with:

```
php artisan vendor:publish --provider="IsaEken\ThemeSystem\ThemeSystemServiceProvider" --tag="theme-system-config" --tag="theme-system-migrations"
php artisan migrate
```

Run the following command in the terminal for initializing:

```
php artisan themes:init
```

Usage
-----

[](#usage)

### Change the theme in runtime

[](#change-the-theme-in-runtime)

```
theme_system()->setTheme('your-theme-name');
```

### Get current theme name

[](#get-current-theme-name)

```
theme_system()->getCurrentTheme();
```

### Set theme per user

[](#set-theme-per-user)

```
// \App\Models\User.php
class User extends Authenticatable
{
    use \IsaEken\ThemeSystem\Traits\CanChooseTheme; // Add this

    // ...
}
```

```
// In your controller or middleware
auth()->user()->theme; // theme for user.
auth()->user()->theme = 'default'; // theme is saved to db.

auth()->user()->themeApply(); // changed current theme to user theme.
```

### Creating theme

[](#creating-theme)

Run the following command in the terminal.

```
php artisan make:theme your-theme-name
```

Change theme in PHP or application config.

### Webpack

[](#webpack)

> Do not change the main `webpack.mix.js` file.

A special `"webpack.mix.js"` file is created for each theme.

The `"webpack.mix.js"` file of the default theme is in the `"resources"` folder.

You can continue to use the `"webpack.mix.js"` as normal in the default theme.

However, in themes you should use it as in the example.

```
const mix = require('laravel-mix');

mix
    .js(themeResourceRoot + '/js/app.js', 'js')
    .postCss(themeResourceRoot + '/css/app.css', 'css', [
        //
    ]);

exports.mix = mix;
```

### Middleware to set a theme

[](#middleware-to-set-a-theme)

Register `ThemeMiddleware` in `app\Http\Kernel.php`:

```
protected $routeMiddleware = [
    // ...
    'theme' => \IsaEken\ThemeSystem\Http\Middlewares\ThemeMiddleware::class,
];
```

Example usages:

```
Route::group(['middleware' => 'theme:your-theme-name'], function () {
    // ...
});

Route::get('/hello-world', fn () => 'Hello World!')->middleware('theme:your-theme-name');
```

### If you need to advanced methods, see ThemeSystem class.

[](#if-you-need-to-advanced-methods-see-themesystem-class)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Isa Eken](https://github.com/isaeken)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 96% 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 ~2 days

Total

6

Last Release

1673d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27427375a2832cfe00cf076041951fd56f9cafa9696e77887bee805101f49bb9?d=identicon)[isaeken](/maintainers/isaeken)

---

Top Contributors

[![isaeken](https://avatars.githubusercontent.com/u/57031552?v=4)](https://github.com/isaeken "isaeken (48 commits)")[![vincenzotecnology](https://avatars.githubusercontent.com/u/100493797?v=4)](https://github.com/vincenzotecnology "vincenzotecnology (2 commits)")

---

Tags

bladeframeworklaravelphpsystemthemelaravelsystemthemeisaeken

###  Code Quality

TestsPest

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/isaeken-laravel-theme-system/health.svg)

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

###  Alternatives

[ryangjchandler/blade-capture-directive

Create inline partials in your Blade templates with ease.

8222.2M12](/packages/ryangjchandler-blade-capture-directive)[spatie/laravel-blade-comments

Add debug comments to your rendered output

177325.5k](/packages/spatie-laravel-blade-comments)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[andreia/filament-nord-theme

A minimalist Arctic Nord theme for FilamentPHP

13334.7k2](/packages/andreia-filament-nord-theme)[daikazu/laravel-glider

Start using Glide on-the-fly instantly in your Laravel blade templates.

882.3k](/packages/daikazu-laravel-glider)[combindma/dash-ui

A streamlined and stylish UI component library for Laravel Blade, crafted with TailwindCSS and AlpineJs for simplicity and elegance.

631.4k](/packages/combindma-dash-ui)

PHPackages © 2026

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