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

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

karlomikus/theme
================

Add theming support to your Laravel 5.\* projects

v1.0.5(7y ago)704.4k4MITPHPPHP &gt;=5.5.9

Since Oct 21Pushed 7y ago3 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (7)Used By (0)

Laravel Theme
=============

[](#laravel-theme)

[![Build Status](https://camo.githubusercontent.com/f3a91752d2339e2a552f2a9014601407f01b8b56918aceb0c29237e39d3b6a2a/68747470733a2f2f7472617669732d63692e6f72672f6b61726c6f6d696b75732f7468656d652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/karlomikus/theme)[![Latest Stable Version](https://camo.githubusercontent.com/b9d2a6873be7201fc45bc9d1256c25989d0dd84226152586ada713ca49b11ed0/68747470733a2f2f706f7365722e707567782e6f72672f6b61726c6f6d696b75732f7468656d652f762f737461626c65)](https://packagist.org/packages/karlomikus/theme)[![License](https://camo.githubusercontent.com/f3294ec60be1d52f734df6fdbaf81a2c85e165f7da0098bf332de610889bf965/68747470733a2f2f706f7365722e707567782e6f72672f6b61726c6f6d696b75732f7468656d652f6c6963656e7365)](https://packagist.org/packages/karlomikus/theme)

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

### 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 karlomikus/theme
```

Or add the package to your composer file:

```
"karlomikus/theme": "1.*"
```

Next add new service provider and facade to your `config/app.php` file:

```
// Service provider
Karlomikus\Theme\ThemeServiceProvider::class
// Facade
'Theme' => Karlomikus\Theme\Facade\Theme::class
```

Next you need to publish the config file:

```
$ php artisan vendor:publish
```

This will create a theme.php file in your config directory in which you can define your default path to themes directory.

Theme setup
-----------

[](#theme-setup)

Create new folder in your themes directory (default: public/themes) and add views folder (which will hold all your custom views) and theme.json file (contains information about a theme).

```
{
    "name": "Theme name",
    "author": "Karlo Mikuš",
    "description": "Default theme description",
    "version": "1.0",
    "namespace": "theme-folder",
    "parent": null
}
```

This are all available attributes, but the required ones only include: `name`, `author` and `namespace`. Value of `namespace` must be the name of the theme's folder.

If you want your theme to depend on other theme views, just include a parent theme namespace in `parent` attribute.

Example folder structure:

```
- public/
    - themes/
        - theme-1/
            - views/
            - theme.json

```

Usage
-----

[](#usage)

The library will firstly check all available valid themes in theme directory.

You can then set a theme by it's namespace:

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

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 Karlomikus\Theme\Contracts\ThemeInterface;

private $theme;

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

### Theme path

[](#theme-path)

You can set default path to themes folder in config/theme.php file. Please note that currently themes folder must be somewhere inside public folder.

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

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~256 days

Recently: every ~318 days

Total

6

Last Release

2578d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f96da2f5ca709b190bf87cbcc8643553bdfe8ed7dba98f6db95ace7839f02b2a?d=identicon)[karlomikus1](/maintainers/karlomikus1)

---

Top Contributors

[![karlomikus](https://avatars.githubusercontent.com/u/469393?v=4)](https://github.com/karlomikus "karlomikus (53 commits)")

---

Tags

laravelphpthemelaravelthemeviews

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[shipu/themevel

Theme and asset management for laravel

34632.1k1](/packages/shipu-themevel)[andreia/filament-nord-theme

A minimalist Arctic Nord theme for FilamentPHP

13334.7k2](/packages/andreia-filament-nord-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)
