PHPackages                             creativesofttechsolutions/laravelthemes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. creativesofttechsolutions/laravelthemes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

creativesofttechsolutions/laravelthemes
=======================================

Theme Manager for Laravel

v1.0.0(11mo ago)013MITPHPPHP ^8.2

Since Jun 14Pushed 11mo agoCompare

[ Source](https://github.com/creativesofttechsolutions/LaravelThemes)[ Packagist](https://packagist.org/packages/creativesofttechsolutions/laravelthemes)[ RSS](/packages/creativesofttechsolutions-laravelthemes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Laravel Themes Package
======================

[](#laravel-themes-package)

This is a Laravel theme and asset management package. You can easily integrate this package with any Laravel based project.

### Features

[](#features)

- Custom theme path
- Override theme
- Parent theme support
- Unlimited Parent view finding
- Asset Finding
- Theme translator support
- Multiple theme config extension
- Multiple theme changelog extension
- Artisan console commands
- Theme enable only Specific route via middleware
- Almost everything customizable
- Also Laravel 5.5 to Laravel 10 Supported

🛠 Installation
--------------

[](#-installation)

To install the `creativesofttechsolutions/laravelthemes` package, use Composer:

```
composer require creativesofttechsolutions/laravelthemes
```

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

[](#configuration)

Run this command in your terminal to publish this package resources:

```
php artisan vendor:publish --provider="CreativeSoftTechSolutions\LaravelThemes\Providers\ThemeServiceProvider"

```

Artisan Command
---------------

[](#artisan-command)

Run this command in your terminal from your project directory.

Create a theme directory:

```
php artisan theme:create your_theme_name

 What is theme title?:
 >

 What is theme description? []:
 >

 What is theme author name? []:
 >

 What is theme version? []:
 >

 Any parent theme? (yes/no) [no]:
 > y

 What is parent theme name?:
 >
```

List of all themes:

```
php artisan theme:list

+----------+--------------+---------+----------+
| Name     | Author       | Version | Parent   |
+----------+--------------+---------+----------+
| themeone | Vaneet Joshi | 1.1.0   |          |
| themetwo | Vaneet Joshi | 1.0.0   | themeone |
+----------+--------------+---------+----------+
```

Example folder structure:
-------------------------

[](#example-folder-structure)

```
- app/
- ..
- ..
- Themes/
    - themeone/
        - assets
            - css
                - app.css
            - img
            - js
        - views/
            - layouts
                - master.blade.php
            - welcome.blade.php
        - theme.json
     - themetwo/

```

Then run `theme:create` command which describe above.

Now Please see the API List Doc.

View Finding Flow:
------------------

[](#view-finding-flow)

Suppose you want find `welcome.blade.php`

```
 - At first check your active theme
 - If `welcome.blade.php not found in active theme then search parent recursively
 - If `welcome.blade.php not found in parents theme then search laravel default view folder resources/views

```

API List
--------

[](#api-list)

- [set](https://github.com/creativesofttechsolutions/laravelthemes#set)
- [get](https://github.com/creativesofttechsolutions/laravelthemes#get)
- [current](https://github.com/creativesofttechsolutions/laravelthemes#current)
- [all](https://github.com/creativesofttechsolutions/laravelthemes#all)
- [has](https://github.com/creativesofttechsolutions/laravelthemes#has)
- [getThemeInfo](https://github.com/creativesofttechsolutions/laravelthemes#getThemeInfo)
- [assets](https://github.com/creativesofttechsolutions/laravelthemes#assets)
- [lang](https://github.com/creativesofttechsolutions/laravelthemes#lang)

### set

[](#set)

For switching current theme you can use `set` method.

```
Themes::set('theme-name');
```

### get

[](#get)

For getting current theme details you can use `get` method:

```
Themes::get(); // return Array
```

You can also get particular theme details:

```
Themes::get('theme-name'); // return Array
```

```
Themes::get('theme-name', true); // return Collection
```

### current

[](#current)

Retrieve current theme's name:

```
Themes::current(); // return string
```

### all

[](#all)

Retrieve all theme information:

```
Themes::all(); // return Array
```

### has

[](#has)

For getting whether the theme exists or not:

```
Themes::has(); // return bool
```

### getThemeInfo

[](#getthemeinfo)

For info about the specified theme:

```
$themeInfo = Themes::getThemeInfo('theme-name'); // return Collection

$themeName = $themeInfo->get('name');
// or
$themeName = $themeInfo['name'];
```

Also fallback support:

```
$themeInfo = Themes::getThemeInfo('theme-name'); // return Collection

$themeName = $themeInfo->get('changelog.versions');
// or
$themeName = $themeInfo['changelog.versions'];
// or you can also call like as multi dimension
$themeName = $themeInfo['changelog']['versions'];
```

### assets

[](#assets)

For binding theme assets you can use the `assets` method:

```
Themes::assets('your_asset_path'); // return string
```

It's generated at `BASE_URL/theme_roots/your_active_theme_name/assets/your_asset_path`

If `your_asset_path` does not exist then it's find to active theme immediate parent assets folder. Look like `BASE_URL/theme_roots/your_active_theme_parent_name/assets/your_asset_path`

When using helper you can also get assets path:

```
themes('your_asset_path'); // return string
```

If you want to bind specific theme assets:

```
Themes::assets('your_theme_name:your_asset_path'); // return string
// or
themes('your_theme_name:your_asset_path'); // return string
```

**Suppose you want to bind `app.css` in your blade. Then below code can be applicable:**

```

```

Specific theme assets:

```

```

If you want to bind specific theme assets:

```
echo Themes::lang('your_theme_name::your_asset_path'); // return string
// or
echo lang('your_theme_name::your_asset_path'); // return string
```

How to use in Route
-------------------

[](#how-to-use-in-route)

```
Route::get('/', function () {
    Themes::set('your_theme_name');
    return view('welcome');
});
```

***This will firstly check if there is a welcome.blade.php in current theme directory. If none is found then it checks parent theme, and finally falls back to default Laravel views location.***

If you want to specific theme view:

```
Route::get('/', function () {
    Themes::set('your_theme_name');
    return view('your_theme_name::welcome');
});
```

Set theme using route middleware
--------------------------------

[](#set-theme-using-route-middleware)

A helper middleware is included out of the box if you want to define a theme per route. To use it:

First register it in bootstrap/app.php:

```
->withMiddleware(function (Middleware $middleware): void {
    \CreativeSoftTechSolutions\LaravelThemes\Middleware\RouteMiddleware::class,
})
```

Now you can apply the middleware to a route or route-group. Eg:

```
Route::group(['prefix' => 'admin', 'middleware'=>'theme:Your_theme_name'], function() {
    // ... Add your routes here
    // The Your_theme_name will be applied.
});
```

Set theme using web middleware
------------------------------

[](#set-theme-using-web-middleware)

A helper middleware is included out of the box if you want to define a theme per route. To use it:

First register it in app\\Http\\Kernel.php:

```
->withMiddleware(function (Middleware $middleware): void {
    \CreativeSoftTechSolutions\LaravelThemes\Middleware\WebMiddleware::class,
})
```

Theme set from `config/themes.php` .

Then in your controller you can call your view as you would normally do:

```
return view('home');  // This will load the home.blade.php from the the folder you set in your `config/theme.php`
```

### Dependency Injection

[](#dependency-injection)

You can also inject theme instance using ThemeContract, eg:

```
use CreativeSoftTechSolutions\LaravelThemes\Contracts\ThemeContract;

private $theme;

public function __construct(ThemeContract $theme)
{
    $this->theme = $theme
}
```

Troubleshooting
---------------

[](#troubleshooting)

Clear config after runing `vendor publish` (see [Config section](#configuration)) to save issues related to config caching by running:

`php artisan config:cache`

`php artisan config:clear`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance52

Moderate activity, may be stable

Popularity5

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

Unknown

Total

1

Last Release

333d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84709cb56727bcf759bc23c2fc6cbf8efc8ec0bd456a61827ceeeda2bb3050be?d=identicon)[creativesofttechsolutions](/maintainers/creativesofttechsolutions)

---

Top Contributors

[![creativesofttechsolutions](https://avatars.githubusercontent.com/u/216281582?v=4)](https://github.com/creativesofttechsolutions "creativesofttechsolutions (1 commits)")

### Embed Badge

![Health badge](/badges/creativesofttechsolutions-laravelthemes/health.svg)

```
[![Health](https://phpackages.com/badges/creativesofttechsolutions-laravelthemes/health.svg)](https://phpackages.com/packages/creativesofttechsolutions-laravelthemes)
```

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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