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

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

vsmartcode/themevel
===================

Theme and asset management for laravel 5

01PHPCI failing

Since Mar 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/vsmartcode/themevel)[ Packagist](https://packagist.org/packages/vsmartcode/themevel)[ RSS](/packages/vsmartcode-themevel/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#laravel-themevel)

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

### Features

[](#features)

- Custom theme location
- Parent theme support
- Unlimited Parent view finding
- Asset Finding
- Theme translator support
- Multiple theme config extension
- Multiple theme changelog extension
- Artisan console commands

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 vsmartcode/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:

```
vsmartcode\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' => vsmartcode\Themevel\Facades\Theme::class,
```

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

```
php artisan vendor:publish --provider="vsmartcode\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? []:
 >

 What is theme type? []:
 >

 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 | vsmartcode Ahamed | 1.1.0   |          |
| themetwo | vsmartcode 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

```

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.

API List
--------

[](#api-list)

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

```
echo Theme::lang('content.title'); // return string
// or
echo lang('content.title'); // 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' => \vsmartcode\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' => [
        // ...
        \vsmartcode\Themevel\Middleware\WebMiddleware::class,
    ],
    // ...
];
```

Theme set from `config/theme.php` .

### Dependency Injection

[](#dependency-injection)

You can also inject theme instance using ThemeContract, eg:

```
use vsmartcode\Themevel\Contracts\ThemeContract;

private $theme;

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

Credits
-------

[](#credits)

- [vsmartcode Ahamed](https://github.com/vsmartcode)
- [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/0cb0c2bafddaa0dba55e6a609d4c5a02100dbd81df6cd36c3777820d5c0775f8/68747470733a2f2f626565727061792e696f2f76736d617274636f64652f7468656d6576656c2f62616467652e7376673f7374796c653d62656572)](https://beerpay.io/vsmartcode/themevel) [![Beerpay](https://camo.githubusercontent.com/660d8c612c7839cb5416ddac476085baddb56b6af001fac327d975d127c6d465/68747470733a2f2f626565727061792e696f2f76736d617274636f64652f7468656d6576656c2f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/vsmartcode/themevel?focus=wish)

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![vsmartcode](https://avatars.githubusercontent.com/u/4949809?v=4)](https://github.com/vsmartcode "vsmartcode (6 commits)")

### Embed Badge

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

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

###  Alternatives

[nayjest/str-case-converter

Library for converting strings from camel case to snake case and vice versa.

12484.6k14](/packages/nayjest-str-case-converter)

PHPackages © 2026

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