PHPackages                             pierresilva/laravel-themes - 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. pierresilva/laravel-themes

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

pierresilva/laravel-themes
==========================

Laravel 5.3 Themes Support

5.3(9y ago)21871[1 issues](https://github.com/pierresilva/laravel-themes/issues)MITPHPPHP &gt;=5.6.4

Since Feb 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pierresilva/laravel-themes)[ Packagist](https://packagist.org/packages/pierresilva/laravel-themes)[ RSS](/packages/pierresilva-laravel-themes/feed)WikiDiscussions master Synced 4w ago

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

Laravel Themes
==============

[](#laravel-themes)

Laravel Themes gives the means to group together a set of views and assets for Laravel 5.3.

Quick Installation
------------------

[](#quick-installation)

Begin by installing the package through Composer.

```
composer require pierresilva/laravel-themes

```

Once this operation is complete, simply add both the service provider and facade classes to your project's `config/app.php` file:

#### Service Provider

[](#service-provider)

```
pierresilva\Themes\ThemesServiceProvider::class,
```

#### Facade

[](#facade)

```
'Theme' => pierresilva\Themes\Facades\Theme::class,
```

Publishing The Config File
--------------------------

[](#publishing-the-config-file)

```
php artisan vendor:publish --provider="pierresilva\Themes\ThemesServiceProvider"
```

This will copy the bundled config file to config/themes.php

Configuration Options
---------------------

[](#configuration-options)

#### Default Active Theme

[](#default-active-theme)

Define the default active theme.

```
'active' => 'default'
```

Folder Structure
----------------

[](#folder-structure)

Generating forlder structure from command line.

```
php artisan generate:theme themeslug
```

And fallow the instructions.

Manifest File
-------------

[](#manifest-file)

Each theme must come supplied with a manifest file (theme.json) stored at the root of the theme, which defines supplemental details about the theme.

```
{
    "slug": "default",
    "name": "Default",
    "author": "John Doe",
    "description": "This is an example theme.",
    "version": "1.0"
}
```

#### Get Manifest Properties

[](#get-manifest-properties)

```
echo Theme::getProperty('theme::property_key', 'default value if nothing is returned');
```

#### Set Manifest Properties

[](#set-manifest-properties)

```
Theme::setProperty('theme::property_key', 'new value to be set');
```

Setting The Active Themes
-------------------------

[](#setting-the-active-themes)

#### Using The Config File

[](#using-the-config-file)

#### config/laravel-themes.php

[](#configlaravel-themesphp)

```
...

    'active' => 'foobar'

...
```

#### Setting During Run-Time

[](#setting-during-run-time)

#### app/Http/Controllers/Controller.php

[](#apphttpcontrollerscontrollerphp)

```
use Theme;

...

public function __construct()
{
    Theme::setActive('foobar');
}

...
```

Facade Reference
----------------

[](#facade-reference)

#### Theme::all()

[](#themeall)

Get all themes.

##### Returns

[](#returns)

Collection

##### Example

[](#example)

```
$themes = Theme::all();
```

#### Theme::setActive($theme)

[](#themesetactivetheme)

Sets the active theme that will be used to retrieve view files from.

##### Parameters

[](#parameters)

$theme (string) Theme slug. Required

##### Returns

[](#returns-1)

null

##### Example

[](#example-1)

```
Theme::setActive('bootstrap-theme');
```

#### Theme::getActive()

[](#themegetactive)

Returns the currently active theme.

##### Returns

[](#returns-2)

string

##### Example

[](#example-2)

```
$activeTheme = Theme::getActive();
```

#### Theme::view($view, $data)

[](#themeviewview-data)

Renders the defined view. This will first check if the currently active theme has the requested view file; if not, it will fallback to loading the view file from the default view directory supplied by Laravel.

##### Parameters

[](#parameters-1)

$view (string) Relative path to view file. Required $data (mixed) Any additional data you'd like to pass along to the view file to be displayed.

##### Returns

[](#returns-3)

View

##### Example

[](#example-3)

```
$foo = 'bar';

return Theme::view('welcome', compact('foo'));
```

#### Theme::response($view, $data, $status, $headers)

[](#themeresponseview-data-status-headers)

Rendered the defined view in the same manner that Theme::view() does, but allows the means to set a custom status response and header for the rendered page.

##### Parameters

[](#parameters-2)

$view (string) Relative path to view file. Required $data (mixed) Any additional data you'd like to pass along to the view file to be displayed. $status (integer) HTTP status code. $header (array) HTTP headers.

##### Returns

[](#returns-4)

Response

##### Example

[](#example-4)

```
$posts = Post::orderBy('published', 'desc')->get();

return Theme::response('blog.rss', compact('posts'), 200, [
    'Content-Type' => 'application/atom+xml; charset=UTF-8'
]);
```

Start building some awesome themes!
-----------------------------------

[](#start-building-some-awesome-themes)

Let's say we have bootstrap theme in our application with the following structure:

```
public/
    |-- themes/
        |-- bootstrap/
            |-- theme.json
            |-- assets/
                |-- css/
                    |-- bootstrap.css
                |-- img/
                |-- js/
                    |-- bootstrap.js
                    |-- jquery.js
            |-- views/
                |-- layout.blade.php
                |-- auth/
                    |-- login.blade.php

```

First, we need **theme.json** manifest file.

```
{
    "slug": "bootstrap",
    "name": "Bootstrap",
    "author": "Jhon Doe",
    "description": "Bootstrap theme.",
    "version": "1.0.0"
}
```

```
>

        Bootstrap Theme Sample

            @yield('content')

```

Please take note that we need to use **Theme::asset()** to load our theme asset files. The bootstrap is a theme slug defined in our **theme.json** file.

In our controller, load the view using the following code:

```
public function getLogin()
{
    return Theme::view('auth.login');
}
```

Now, for our login.blade.php:

```
@extends('bootstrap::layout')

@section('content')
    Log In

        {!! csrf_field() !!}

            Email

            Password

             Remember Me

            Login

@endsection
```

Note that we are using **@extends('bootstrap::layout')** in our login view, where bootstrap is a theme slug defined in our theme.json and layout is our layout file.

Author
------

[](#author)

[Pierre Silva](http://www.lab3studio.com)

License
-------

[](#license)

The Laravel Themes is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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

3429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6ce55dfbef0ea377fd37036b1d94a4657998999d15019542b3dd8938ca7ae72a?d=identicon)[pierresilva](/maintainers/pierresilva)

---

Top Contributors

[![pierresilvalab3](https://avatars.githubusercontent.com/u/22989289?v=4)](https://github.com/pierresilvalab3 "pierresilvalab3 (22 commits)")

---

Tags

laravelbladethemespierresilva

### Embed Badge

![Health badge](/badges/pierresilva-laravel-themes/health.svg)

```
[![Health](https://phpackages.com/badges/pierresilva-laravel-themes/health.svg)](https://phpackages.com/packages/pierresilva-laravel-themes)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M341](/packages/psalm-plugin-laravel)[moonshine/moonshine

Laravel administration panel

1.3k253.1k78](/packages/moonshine-moonshine)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M125](/packages/roots-acorn)[blade-ui-kit/blade-icons

A package to easily make use of icons in your Laravel Blade views.

2.5k42.5M397](/packages/blade-ui-kit-blade-icons)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.3k453.6k30](/packages/tightenco-jigsaw)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M128](/packages/laravel-pulse)

PHPackages © 2026

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