Inspired by bigecko/laravel-theme. Themes are stored inside default laravel's resources folder
Require this package in your composer.json:
composer require yaap/themeOr manually add
"yaap/theme": "4.*"Optionally, publish config using artisan CLI (if you want to overwrite default config).
php artisan vendor:publish --provider="YAAP\Theme\ThemeServiceProvider" return array(
'path' => base_path('resources/themes'),
'assets_path' => 'themes',
); return array(
'name' => 'default',
'inherit' => null,
);├── themes/
├── default/
| ├── assets/
├── lang/
├── layouts/
├── partials/
├── views/
| └── hello.blade.php
└── config.php
└── admin/
├── views/
| ├── emails/
| | └── notify.blade.php
| └── hello.blade.php
├── public/
└── themes/
└── default/
├── css/
| └── styles.css
└── images/
└── icon.png
The first time you have to create theme "default" structure, using the artisan command:
php artisan theme:create defaultIn order to seed webpack.mix.js with custom rules add --with-mix option
php artisan theme:create default --with-mixTo delete an existing theme, use the command:
php artisan theme:destroy defaultTheme::init($name)This will add to views find path:
- themes/{$name}
- themes/{$name}/views
Lang files will be added as well:
- themes/{$name}/lang
View::make('hello');
View::make('emails.notify');Use laravel mix for assets.
<link rel="stylesheet" href="{{ mix('/themes/default/css/app.min.css') }}"/><script type="text/javascript" src="{{ mix('/themes/default/js/app.min.js') }}"></script>###Blade templates
@extends('layouts.master')
@include('partials.header')
@section('content')
<section id="main">
<h1>HOME</h1>
</section>
@stop
@include('partials.footer')
###Fallback capability
You still able to use default View::make('emails.notify') which is stored outside the themes directory
Yes! Say hi: [email protected]
We will be happy to work with you! Other work we’ve done
Stay up to date with the latest Vuestic news! Follow us on LinkedIn or Facebook
MIT license.