Simple Laravel 5+ (5.4) Theme Switcher with Middleware!

Related tags

Laravel larathemes
Overview

Laravel Theme

The simpliest of theme switching for Laravel 5

Installation

Laravel 5.1+

Install Laravel Theme manager:

composer require codewithtony/larathemes

At config/app.php, add the Service Provider and the Facade:

    'providers' => [
        Tony\Themes\ThemeServiceProvider::class,
    ]

    //...

    'aliases' => [
        'Theme' => Tony\Themes\Themes\ThemeFacade::class,
    ]

Usage

Recommended Structure

themes
  ├── [theme name]
  |   └── assets
  |   └── views
  |
  └── [theme name]
      └── assets
      └── views

Setting a theme

Changing your theme is easy

Theme::set('my-theme')

Easily use the Middleware to change themes for an entire group

Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'theme:admin'], function () {
    //...
});

Calling a view

Load your views like normal, Laravel Theme will look for your view in the set theme and if it isn't found, view finding will remain the same

You can reuse views by storing them outside of your theme and just uses view('layout.master') and have your layout/master.blade.php inside you themes.

Assets

Your assets will need to be sent to your public folder still.

Contribute

Your help is more than welcome!

License

Licensed under the The MIT License (MIT). Please see LICENSE for more information.

You might also like...
Admin Theme based on the AdminLTE Template for easy integration into symfony

Admin Theme based on the AdminLTE Template for easy integration into symfony

Bootstrap Theme Generator inside of a Wordpress-Settings-Page. Includes live compilation of SCSS!

Bootstrap-Theme-Generator Bootstrap Theme Generator enables you to choose which components of Bootstrap you want to load. It also gives you the possib

Validate your input data in a simple way, an easy way and right way. no framework required. For simple or large. project.

wepesi_validation this module will help to do your own input validation from http request POST or GET. INTEGRATION The integration is the simple thing

List of 77 languages for Laravel Framework 4, 5, 6, 7 and 8, Laravel Jetstream , Laravel Fortify, Laravel Breeze, Laravel Cashier, Laravel Nova and Laravel Spark.

Laravel Lang In this repository, you can find the lang files for the Laravel Framework 4/5/6/7/8, Laravel Jetstream , Laravel Fortify, Laravel Cashier

A Laravel package that adds a simple image functionality to any Laravel model
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.

Webdevetc BlogEtc - Complete Laravel Blog Package Quickly add a blog with admin panel to your existing Laravel project. It has everything included (ro

A simple Laravel service provider for easily using HTMLPurifier inside Laravel

HTMLPurifier for Laravel 5/6/7/8 A simple Laravel service provider for easily using HTMLPurifier inside Laravel. From their website: HTML Purifier is

 Laravel Logable is a simple way to log http request in your Laravel application.
Laravel Logable is a simple way to log http request in your Laravel application.

Laravel Logable is a simple way to log http request in your Laravel application. Requirements php = 7.4 Laravel version = 6.0 Installation composer

Laravel HTMLMin - a simple HTML minifier for Laravel

Laravel HTMLMin Laravel HTMLMin is currently maintained by Raza Mehdi, and is a simple HTML minifier for Laravel. It utilises Mr Clay's Minify package

Releases(1.2)
Owner
null
Textpattern-default-theme - Textpattern CMS default theme.

Textpattern CMS default theme This project is the source for the default theme that ships as standard with Textpattern CMS. It is intended as a starti

Textpattern CMS 61 Nov 21, 2022
Textpattern-jquery-ui-theme - The jQuery UI theme used within the Textpattern CMS admin-side.

Textpattern jQuery UI theme The jQuery UI theme used within the Textpattern CMS admin-side. Supported web browsers Chrome, Edge, Firefox, Safari and O

Textpattern CMS 12 Jan 10, 2022
Sqlcommenter is a plugin/middleware/wrapper to augment SQL statements from laravel

sqlcommenter is a plugin/middleware/wrapper to augment SQL statements from laravel with comments that can be used later to correlate user code with SQL statements.

Google 7 Jul 14, 2022
An HTTP Interop compatible middleware dispatcher in Equip

An HTTP Interop compatible middleware dispatcher in Equip. Attempts to be PSR-1, PSR-2, PSR-4, PSR-7, and PSR-15 compliant.

Equip 24 Aug 10, 2022
Multi theme support for Laravel application

Multi theme support for Laravel application This Laravel package adds multi-theme support to your application. It also provides a simple authenticatio

QiroLab 287 Dec 29, 2022
Theme and asset management for laravel

Laravel-Themevel Themevel is a Laravel theme and asset management package. You can easily integrate this package with any Laravel based project. Featu

Shipu Ahamed 339 Dec 23, 2022
Support multi theme for Laravel application

Very short description of the package This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention o

Ephraïm SEDDOR 1 Dec 1, 2021
Theme and asset management for laravel

Laravel-Themevel Themevel is a Laravel theme and asset management package. You can easily integrate this package with any Laravel based project. Featu

Shipu Ahamed 339 Dec 23, 2022
Ten Theme From Youtube Videos

Webverse_ten This is the main branch of the Ten Theme from Youtube Videos, to view the progress of a specific video switch to the corresponding branch

Webverse 10 Dec 5, 2022
🧾 Online test site with the human sciences theme. Using: HTML5, CSS3, Js., PHP7 and MySQL. 🚀

form-ciencias-humanas ?? Technologies Lunacy HTML5 CSS3 PHP7 MYSQL Animate.css Illustrations from icons8: Earth care from Anna Antipina Earth and Moon

Vinícius 1 Jan 9, 2022