PHPackages                             shipu/themevel - 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. shipu/themevel

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

shipu/themevel
==============

Theme and asset management for laravel

v3.0.4(2y ago)34632.1k↓35.3%67[3 issues](https://github.com/Shipu/themevel/issues)1CC-BY-3.0PHPCI failing

Since May 20Pushed 2y ago9 watchersCompare

[ Source](https://github.com/Shipu/themevel)[ Packagist](https://packagist.org/packages/shipu/themevel)[ Docs](https://github.com/shipu/themevel)[ GitHub Sponsors](https://github.com/shipu)[ RSS](/packages/shipu-themevel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (18)Used By (1)

Laravel-Themevel
================

[](#laravel-themevel)

[![Latest Stable Version](https://camo.githubusercontent.com/a6107e28bfd05e8c635e538b9cb354a6eb8aa8a9e7a3cb01265036dc0497d133/68747470733a2f2f6170692e7472617669732d63692e6f72672f73686970752f7468656d6576656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/shipu/themevel)[![Latest Stable Version](https://camo.githubusercontent.com/ffc7aad553fd765a5f05a20cbc3fa6182e4ed347b23e87ccaead38b32ee5c213/68747470733a2f2f706f7365722e707567782e6f72672f73686970752f7468656d6576656c2f762f737461626c65)](https://packagist.org/packages/shipu/themevel)[![Latest Unstable Version](https://camo.githubusercontent.com/02336815c856bc127d7b9dade72f9ddab50d5fd08eaaefddb2719d581ec31863/68747470733a2f2f706f7365722e707567782e6f72672f73686970752f7468656d6576656c2f762f756e737461626c65)](https://packagist.org/packages/shipu/themevel)[![License](https://camo.githubusercontent.com/a0d0bbe66a6ff2cc99bea6440e0c0554fe0a0a828eeda81765834950e3a4101d/68747470733a2f2f706f7365722e707567782e6f72672f73686970752f7468656d6576656c2f6c6963656e7365)](https://packagist.org/packages/shipu/themevel)

Themevel 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)

Themevel is a Laravel package so you can install it via Composer. Run this command in your terminal from your project directory:

```
composer require shipu/themevel
```

Wait for a while, Composer will automatically install Themevel in your project.

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

[](#configuration)

Below **Laravel 5.5** you have to call this package service in `config/app.php` config file. To do that, add this line in `app.php` in `providers` array:

```
Shipu\Themevel\Providers\ThemevelServiceProvider::class,
```

Below **Laravel 5.5** version to use facade you have to add this line in `app.php` to the `aliases` array:

```
'Theme' => Shipu\Themevel\Facades\Theme::class,
```

Now run this command in your terminal to publish this package resources:

```
php artisan vendor:publish --provider="Shipu\Themevel\Providers\ThemevelServiceProvider"

```

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 | Shipu Ahamed | 1.1.0   |          |
| themetwo | Shipu Ahamed | 1.0.0   | themeone |
+----------+--------------+---------+----------+
```

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

[](#example-folder-structure)

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

```

You can change `theme.json` and `changelog.yml` name from `config/theme.php`

```
// ..
'config' => [
    'name' => 'theme.json',
    'changelog' => 'changelog.yml'
],
// ..
```

`json`, `yml`, `yaml`, `php`, `ini`, `xml` extension supported.

For example:

```
// ..
'config' => [
    'name' => 'theme.json',
    'changelog' => 'changelog.json'
],
// ..
```

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/shipu/themevel#set)
- [get](https://github.com/shipu/themevel#get)
- [current](https://github.com/shipu/themevel#current)
- [all](https://github.com/shipu/themevel#all)
- [has](https://github.com/shipu/themevel#has)
- [getThemeInfo](https://github.com/shipu/themevel#getThemeInfo)
- [assets](https://github.com/shipu/themevel#assets)
- [lang](https://github.com/shipu/themevel#lang)

### set

[](#set)

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

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

### get

[](#get)

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

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

You can also get particular theme details:

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

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

### current

[](#current)

Retrieve current theme's name:

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

### all

[](#all)

Retrieve all theme information:

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

### has

[](#has)

For getting whether the theme exists or not:

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

### getThemeInfo

[](#getthemeinfo)

For info about the specified theme:

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

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

Also fallback support:

```
$themeInfo = Theme::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:

```
Theme::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:

```
Theme::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:

```

```

### lang

[](#lang)

The `lang` method translates the given language line using your current **theme** [localization files](https://laravel.com/docs/master/localization):

```
echo Theme::lang('content.title'); // return string
// or
echo lang('content.title'); // return string
```

also support

```
echo Theme::lang('content.title', [your replace array], 'your desire locale'); // return string
// or
echo lang('content.title', [your replace array], 'your desire locale'); // return string
```

If you want to bind specific theme assets:

```
echo Theme::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 () {
    Theme::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 () {
    Theme::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 app\\Http\\Kernel.php:

```
protected $routeMiddleware = [
    // ...
    'theme' => \Shipu\Themevel\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:

```
protected $middlewareGroups = [
    'web' => [
        // ...
        \Shipu\Themevel\Middleware\WebMiddleware::class,
    ],
    // ...
];
```

Theme set from `config/theme.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 Shipu\Themevel\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`

Credits
-------

[](#credits)

- [Shipu Ahamed](https://github.com/shipu)
- [All Contributors](../../contributors)

Support for this project
------------------------

[](#support-for-this-project)

Hey dude! Help me out for a couple of 🍻!

[![Beerpay](https://camo.githubusercontent.com/f40c6e29932b6a4ac2cb9b405fcbdeaee210cc1ed4d76624e6e757606c9b6006/68747470733a2f2f626565727061792e696f2f53686970752f7468656d6576656c2f62616467652e7376673f7374796c653d62656572)](https://beerpay.io/Shipu/themevel) [![Beerpay](https://camo.githubusercontent.com/000fafacb6da59819f89deebcd62da566d169e95201b850a8551f649682b966e/68747470733a2f2f626565727061792e696f2f53686970752f7468656d6576656c2f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/Shipu/themevel?focus=wish)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 78.4% 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 ~142 days

Recently: every ~191 days

Total

17

Last Release

1015d ago

Major Versions

v1.6 → v2.02020-03-29

v2.2.2 → v3.0.02021-07-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/91fdb46a4f45685ae0d448fbc943b1e4a662b56864b17224a65d14c92ee4e247?d=identicon)[shipu](/maintainers/shipu)

---

Top Contributors

[![Shipu](https://avatars.githubusercontent.com/u/4118421?v=4)](https://github.com/Shipu "Shipu (91 commits)")[![jpagny](https://avatars.githubusercontent.com/u/89133228?v=4)](https://github.com/jpagny "jpagny (11 commits)")[![mikebarlow](https://avatars.githubusercontent.com/u/293049?v=4)](https://github.com/mikebarlow "mikebarlow (3 commits)")[![JunaidQadirB](https://avatars.githubusercontent.com/u/642353?v=4)](https://github.com/JunaidQadirB "JunaidQadirB (2 commits)")[![Cweet](https://avatars.githubusercontent.com/u/6409712?v=4)](https://github.com/Cweet "Cweet (2 commits)")[![robertgdev](https://avatars.githubusercontent.com/u/343614?v=4)](https://github.com/robertgdev "robertgdev (1 commits)")[![Bricklou](https://avatars.githubusercontent.com/u/15181236?v=4)](https://github.com/Bricklou "Bricklou (1 commits)")[![tmtung144](https://avatars.githubusercontent.com/u/19670776?v=4)](https://github.com/tmtung144 "tmtung144 (1 commits)")[![carlwhittick](https://avatars.githubusercontent.com/u/1196095?v=4)](https://github.com/carlwhittick "carlwhittick (1 commits)")[![kohenkatz](https://avatars.githubusercontent.com/u/88755?v=4)](https://github.com/kohenkatz "kohenkatz (1 commits)")[![lex111](https://avatars.githubusercontent.com/u/4408379?v=4)](https://github.com/lex111 "lex111 (1 commits)")[![ridislam](https://avatars.githubusercontent.com/u/7835820?v=4)](https://github.com/ridislam "ridislam (1 commits)")

---

Tags

assetsbladeblade-templatechild-themelaravelmanagementmulti-domainphpspecific-themeswitch-themethemetheme-detailstheme-directorytheme-generatortheme-settingstheme-switcherthemeveltranslateslaravellumenthememanagementmultiassetthemevelchild-theme

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shipu-themevel/health.svg)

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

###  Alternatives

[teepluss/theme

Theme will help you organize your themes inside Laravel projects easily and maintain its related assets, layouts and partials for the theme in single directory.

543174.1k8](/packages/teepluss-theme)[yaap/theme

Theme support for Laravel with assets, theme extends etc.

9544.1k2](/packages/yaap-theme)[andreia/filament-nord-theme

A minimalist Arctic Nord theme for FilamentPHP

13334.7k2](/packages/andreia-filament-nord-theme)[karlomikus/theme

Add theming support to your Laravel 5.\* projects

704.4k](/packages/karlomikus-theme)[filafly/brisk

A simple, friendly theme for Filament.

2211.9k1](/packages/filafly-brisk)

PHPackages © 2026

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