PHPackages                             lukeed/lumen-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. lukeed/lumen-theme

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

lukeed/lumen-theme
==================

Add theming support to your Lumen 5.\* projects

v1.0.4(8y ago)51.8k2[1 issues](https://github.com/lukeed/lumen-theme/issues)[1 PRs](https://github.com/lukeed/lumen-theme/pulls)MITPHPPHP &gt;=5.5.9

Since Oct 21Pushed 8y ago3 watchersCompare

[ Source](https://github.com/lukeed/lumen-theme)[ Packagist](https://packagist.org/packages/lukeed/lumen-theme)[ Docs](https://github.com/lukeed/lumen-theme)[ RSS](/packages/lukeed-lumen-theme/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (6)Used By (0)

Lumen Theme
===========

[](#lumen-theme)

[![Build Status](https://camo.githubusercontent.com/62965cb48b303a7124ebbb8ab3015b7580c881a7283c1d9b42625dcac5c30e69/68747470733a2f2f7472617669732d63692e6f72672f6c756b6565642f6c756d656e2d7468656d652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lukeed/lumen-theme)[![Latest Stable Version](https://camo.githubusercontent.com/c52d346956d52ea330ab7e89983a60679d827110652b211da8851707b41c8645/68747470733a2f2f706f7365722e707567782e6f72672f6c756b6565642f6c756d656e2d7468656d652f762f737461626c65)](https://packagist.org/packages/lukeed/lumen-theme)[![License](https://camo.githubusercontent.com/f5c7eb7e3510346ca13ed59ab70e5363e18f27f875116310b7cf817eb1910ca5/68747470733a2f2f706f7365722e707567782e6f72672f6c756b6565642f6c756d656e2d7468656d652f6c6963656e7365)](https://packagist.org/packages/lukeed/lumen-theme)

Add theming support to your Lumen 5.\* projects.

For Laravel support, go to [Laravel Theme](https://github.com/karlomikus/theme).

### Features

[](#features)

- Custom theme locations
- Support for theme inheritence with theme fallback
- Theme assets loading
- Artisan console commands

Install
-------

[](#install)

Require it via terminal like so:

```
$ composer require lukeed/lumen-theme
```

Or add the package to your composer file:

```
"lukeed/lumen-theme": "1.*"
```

Add a new service provider and optional facade to your `bootstrap/app.php` file:

```
// Service provider
$app->register(Lukeed\Theme\ThemeServiceProvider::class);

// Facade
class_alias(Lukeed\Theme\Facade\Theme::class, 'Theme');
```

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

[](#configuration)

#### theme.path

[](#themepath)

> Type: string

> Default: `public/themes`

The path to the `themes` directory, where all themes should live.

To change this value, you may either create a custom `config/theme.php` file and load it inside `bootstrap/app.php` or you may set the value directly via the `config()` helper anywhere inside your application.

```
// bootstrap/app.php
config(['theme.path' => realpath(base_path('public/custom/path/themes'))]);
```

OR

```
// config/theme.php
return [
    'path' => realpath(base_path('public/custom/path/themes'))])
];

// bootstrap/app.php
$app->configure('theme');
```

Creating a Theme
----------------

[](#creating-a-theme)

Every theme directory **must** contain a `views` folder and a `theme.json` file, which contains descriptive information about the theme.

```
{
    "name": "Theme name",
    "author": "Author Name",
    "description": "Default theme description",
    "version": "1.0",
    "directory": "theme-folder",
    "parent": null
}
```

The `name`, `author` and `directory` fields are **required**.

The `directory` value must match the name of the theme directory; eg: `public/themes/theme-folder`.

If your theme is meant to extend or inherit another theme's views, include the `directory` name "parent theme" as the `parent` value; eg: `parent-folder`.

View Hierarchy
--------------

[](#view-hierarchy)

Given the example:

```
view('home');
```

The currently active theme will be scanned for a `home.blade.php`.

If there is a `parent` attached to the theme, its directory will be scanned next.

Lastly, Lumen's `view.paths` config value will searched. By default, this is `resources/views`.

Usage
-----

[](#usage)

The `theme.path` directory will be scanned for all available themes.

**If only one theme is found, it will automatically be selected as the active theme.** To manually select a different theme, you may use the `set` method which accepts a `directory` value.

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

Then you call views like you usually do in laravel:

```
view('home', []);
```

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

You can also inject theme instance using ThemeInterface.

```
use lukeed\Theme\Contracts\ThemeInterface;

private $theme;

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

Available methods
-----------------

[](#available-methods)

Here's the list of methods you can access:

```
// Activate/set theme
Theme::set('theme-namespace');

// Get all available themes as an array
Theme::all();

// Get currently active
Theme::get();

// Get theme by namespace
Theme::get('specific-namespace');

// Override default theme path
Theme::setDefaultThemePath('new/path/to/themes');

// Check if theme exists
Theme::has('theme-namespace');

// Render theme path URL
theme_url('assets/style.css');
```

### Artisan commands

[](#artisan-commands)

Get a table of all found themes:

```
$ php artisan theme:list

+------------------+-------------+------------+
| Name             | Author      | Namespace  |
+------------------+-------------+------------+
| Bootstrap theme  | Karlo Mikus | bootstrap  |
| Default theme    | Test Author | default    |
| Foundation theme | Lorem Ipsum | foundation |
| Test theme       | Dolor Sitha | test       |
+------------------+-------------+------------+
```

Create a theme directory with config file:

```
$ php artisan theme:make

 Template name:
 > Theme name

 Template author:
 > Firstn Lastn

Theme created succesfully!
```

Changelog
---------

[](#changelog)

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

TODO
----

[](#todo)

- Contact me for ideas

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 73.2% 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 ~172 days

Total

5

Last Release

3217d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5855893?v=4)[Luke Edwards](/maintainers/lukeed)[@lukeed](https://github.com/lukeed)

---

Top Contributors

[![karlomikus](https://avatars.githubusercontent.com/u/469393?v=4)](https://github.com/karlomikus "karlomikus (41 commits)")[![lukeed](https://avatars.githubusercontent.com/u/5855893?v=4)](https://github.com/lukeed "lukeed (14 commits)")[![salihkiraz](https://avatars.githubusercontent.com/u/7440402?v=4)](https://github.com/salihkiraz "salihkiraz (1 commits)")

---

Tags

lumentemplatesthemeviews

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lukeed-lumen-theme/health.svg)

```
[![Health](https://phpackages.com/badges/lukeed-lumen-theme/health.svg)](https://phpackages.com/packages/lukeed-lumen-theme)
```

###  Alternatives

[league/plates

Plates, the native PHP template system that's fast, easy to use and easy to extend.

1.5k6.1M263](/packages/league-plates)[shipu/themevel

Theme and asset management for laravel

34632.6k1](/packages/shipu-themevel)[karlomikus/theme

Add theming support to your Laravel 5.\* projects

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

An easy way to intergrate Twitter Bootstrap with Laravel.

232.7k](/packages/cornford-bootstrapper)[devanych/view-renderer

Simple PHP View Renderer

153.3k1](/packages/devanych-view-renderer)[mobicms/render

Native PHP template engine

106.9k1](/packages/mobicms-render)

PHPackages © 2026

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