Skip to content
Giannis Gasteratos edited this page Apr 30, 2018 · 4 revisions

How it works

Very simple, you create a folder for each Theme in 'resources/views' and keep all your views separated. The same goes for assets: create a folder for each theme in your 'public' directory. Set your active theme and you are done. The rest of your application remains theme-agnostic©, which means that when you View::make('index') you will access the index.blade.php from your selected theme's folder. Same goes for your assets.

Installation

install with

composer require "igaster/laravel-theme"

Add the service provider in app/config/app.php, Providers array (This is optional Laravel 5.5+ as it will be auto-discovered):

Igaster\LaravelTheme\themeServiceProvider::class,

also in the same file edit the aliases array and add:

'Theme' => Igaster\LaravelTheme\Facades\Theme::class,

Almost Done. You can optionally publish a configuration file to your application with

php artisan vendor:publish --provider="Igaster\LaravelTheme\themeServiceProvider"

That's it. You are now ready to start theming your applications!