2017 © Pedro Peláez
 

library laravel-theme

Theme Management for Laravel 5.*

image

buzz/laravel-theme

Theme Management for Laravel 5.*

  • Monday, January 4, 2016
  • by Mr.Buzz
  • Repository
  • 1 Watchers
  • 5 Stars
  • 87 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

Theme Management for Laravel 5.*

Detect device use package serbanghita/Mobile-Detect. If you want to be simple, use a version 1. Note: v2.* switch language to vietnamese, (*1)

Contents

  1. Introduction
  2. Installation
  3. Configuration
  4. Structure
  5. Usage

Introduction

This is package support the management view files and assets under separate folders. Compatible with Laravel 5.*, (*2)

Installation

The first run command:, (*3)

composer require buzz/laravel-theme 2.*

and then open config/app.php add LaravelThemeServiceProvider to array providers, (*4)

'providers' => [
    //.....
    'Illuminate\Validation\ValidationServiceProvider',
    'Illuminate\View\ViewServiceProvider,
    //.....
    'Buzz\LaravelTheme\LaravelThemeServiceProvider',
],

Add Theme alias (when set auto_alias => false in theme config):, (*5)

'aliases' => [
    //.....
    'Validator' => 'Illuminate\Support\Facades\Validator',
    'View'      => 'Illuminate\Support\Facades\View',
    //.....
    'Theme' =>  'Buzz\LaravelTheme\ThemeFacade',
],

Configuration

Publish config file config/theme.php with command:, (*6)

php artisan vendor:publish --provider="Buzz\LaravelTheme\LaravelThemeServiceProvider"

Usage

Structure

Assets
├── public/
    └── themes/
        ├── theme_name/
        |   ├── js/
        |   ├── css/
        |
        └── another_theme_name/

Views
├── resources/
    └── themes/
        ├── theme_name/
        |   ├── index.blade.php
        |   ├── footer.blade.php
        |
        └── another_theme_name/

Render view

package does not change the way you render view, you still use the View::make or view() as default of laravel, read more on views document. If the render view and the view does not exist in the resources/themes/theme-name, it will render view in resources/views., (*7)

Theme assets

Use themeAsset() instead of asset() when link to assets in theme, example:, (*8)

<link rel="stylesheet" href="{!! themeAsset('css/bootstrap.css') !!}">
//render <link rel="stylesheet" href="http://domain/themes/theme-name/css/bootstrap.css">

Change current theme

You can change the theme in the following ways:, (*9)

app('theme')->set($themeName)

Or use function helper, (*10)

setTheme($themeName);//function helper

or use Facade, (*11)

Theme::set($themeName);//use facade

Support methods

Theme::client();//return object of MobileDetect
Theme::pathTheme($name = null);//return path to current theme or name input
Theme::currentTheme();//return name of current theme
Theme::reset();//reset default theme
Theme::set();//set theme
Theme::allTheme($except = [], $config = true);//get list theme in folder themes
themeAsset($name = false);//link to asset current theme or by theme name
setTheme($name);// change theme by theme name

Support other config provider

By default package use provider config of laravel, you can change to provider you want by edit config 'config_provider' => 'provider_name', (*12)

P/s: excuse me my English., (*13)

The Versions

04/01 2016

dev-master

9999999-dev https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

04/01 2016

v2.4.3

2.4.3.0 https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

03/01 2016

v2.4.2

2.4.2.0 https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

03/01 2016

v2.4.1

2.4.1.0 https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

03/01 2016

v2.4

2.4.0.0 https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

02/11 2015

v2.3.3

2.3.3.0 https://github.com/thinhbuzz/laravel-theme

Theme Management for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5 theme manager theme management

02/11 2015

v2.3.2

2.3.2.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

02/11 2015

v2.3.1

2.3.1.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

02/11 2015

v2.3

2.3.0.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

01/11 2015

v2.2

2.2.0.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

01/11 2015

v2.1

2.1.0.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

25/08 2015

v2.0

2.0.0.0 https://github.com/thinhbuzz/laravel-theme

Package quản lý theme cho Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

25/08 2015

v1.3.1

1.3.1.0 https://github.com/thinhbuzz/laravel-theme

Themes management package for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

21/08 2015

v1.3

1.3.0.0 https://github.com/thinhbuzz/laravel-theme

Themes management package for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

19/08 2015

v1.2

1.2.0.0 https://github.com/thinhbuzz/laravel-theme

Themes management package for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

07/08 2015

v1.1

1.1.0.0 https://github.com/thinhbuzz/laravel-theme

Themes management package for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5

07/08 2015

v1.0

1.0.0.0 https://github.com/thinhbuzz/laravel-theme

Themes management package for Laravel 5.*

  Sources   Download

MIT

The Requires

 

laravel theme themes laravel5