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

ActiveLibrary

andheiberg/theme
================

A modular themeing system based on the blade syntax.

4.0.1(8y ago)23841PHPPHP &gt;=5.3.0

Since Dec 30Pushed 8y ago1 watchersCompare

[ Source](https://github.com/AndreasHeiberg/laravel-theme)[ Packagist](https://packagist.org/packages/andheiberg/theme)[ RSS](/packages/andheiberg-theme/feed)WikiDiscussions master Synced today

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

Theme
=====

[](#theme)

\###A simple modular approach to theming created to blend in with Blade. The concept is to split your theme up into modules that can be reused and changed easily. These modules are stored as simple view files in resources/views/vendor/theme. An example of a typical module could be a hero unit. You would store your hero model like so:

```
+@form(['route' => 'auth.register'])
	+@formText('username', 'What do you want to be called?')->placeholder('darthvader')

	+@formPassword('password') // if you don't provide a label it will capitalize the key

	+@formHidden('awesomeness', 11)

	+@formSelect('gender', 'Your gender', ['Male', 'Female'])->required()

	+@formDate('born_at', 'Birthdate')
-@form

```

It's especially powerful for forms. By default it will fill old values and show validation messages. It reduces view code by +10x for typical forms.

It can be used for anything though. Modules are easy to define.

```
// resources/views/vendor/theme/hero.blade.php

```

This module can then intern be used from a view like so:

```
+@hero()
	It might be yet another twitter client, but this one is really nice
	Seriously I mean it I wouldn't want to disapoint you, but it's amazing.
-@hero

```

As you can see the html comment `\` seperates the start and ending of modules. If you choose to exclude this comment you could create a module like so:

```
// app/views/theme/button.blade.php
{{ $text }}

```

And use it like so (without an ending tag):

```
+@button('url', 'text')

```

Also multiword modules are like so:

```
// app/views/theme/page-header.blade.php

```

And called like so:

```
+@pageHeader()
	Some header
-@pageHeader

```

Why is this helpful?
--------------------

[](#why-is-this-helpful)

- Easily change your markup site wide (this is really useful if you start prototyping with Bootstrap or Foundation and then want to use your own markup later)
- Easier to modify and understand than something like Former
- Easier to read (ever seen comments like ``? well now the modules end is prefixed by `-@` so that should no longer be needed)

Installation
------------

[](#installation)

Add the following to your composer.json:

```
"andheiberg/theme": "4.0.*" // "1.0.*" for Laravel 4.1 support, "2.0.*" for Laravel 4.2 support, "3.1.*" for Laravel 5 and 5.1 support

```

Add Theme's service provider to your Laravel application in config/app.php. Add the following to the providers:

```
Andheiberg\Theme\ThemeServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,

```

And to the aliases:

```
'Form' => Collective\Html\FormFacade::class,

```

If you would like to use another theme than default you would have to publish the settings and change the theme setting:

```
php artisan vendor:publish --provider="Andheiberg\Theme\ThemeServiceProvider"

```

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~86 days

Recently: every ~205 days

Total

18

Last Release

3001d ago

Major Versions

1.0.x-dev → 2.0.02014-05-29

2.0.4 → 3.0.02015-08-01

3.0.x-dev → 4.0.02016-07-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/207626c3611f7c70c59a8164259c22cb1233b0a8e009d1feae3e45c9351d4c4c?d=identicon)[AndreasHeiberg](/maintainers/AndreasHeiberg)

---

Top Contributors

[![andheiberg](https://avatars.githubusercontent.com/u/820962?v=4)](https://github.com/andheiberg "andheiberg (3 commits)")[![lutsifer](https://avatars.githubusercontent.com/u/6448279?v=4)](https://github.com/lutsifer "lutsifer (1 commits)")

### Embed Badge

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

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

###  Alternatives

[bllim/laravalid

This package makes validation rules defined in laravel work client-side by converting to html/js plugins such as jquery validation. It also allows to use laravel validation messages so you can show same messages for both sides.

5815.2k](/packages/bllim-laravalid)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)

PHPackages © 2026

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