Download the PHP package pierresilva/laravel-themes without Composer
On this page you can find all versions of the php package pierresilva/laravel-themes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pierresilva/laravel-themes
More information about pierresilva/laravel-themes
Files in pierresilva/laravel-themes
Informations about the package laravel-themes
Laravel Themes
Laravel Themes gives the means to group together a set of views and assets for Laravel 5.3.
Quick Installation
Begin by installing the package through Composer.
`
Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php
file:
Service Provider
Facade
Publishing The Config File
This will copy the bundled config file to config/themes.php
Configuration Options
Default Active Theme
Define the default active theme.
Folder Structure
Generating forlder structure from command line.
And fallow the instructions.
Manifest File
Each theme must come supplied with a manifest file (theme.json) stored at the root of the theme, which defines supplemental details about the theme.
Get Manifest Properties
Set Manifest Properties
Setting The Active Themes
Using The Config File
config/laravel-themes.php
Setting During Run-Time
app/Http/Controllers/Controller.php
Facade Reference
Theme::all()
Get all themes.
Returns
Collection
Example
Theme::setActive($theme)
Sets the active theme that will be used to retrieve view files from.
Parameters
$theme (string) Theme slug. Required
Returns
null
Example
Theme::getActive()
Returns the currently active theme.
Returns
string
Example
Theme::view($view, $data)
Renders the defined view. This will first check if the currently active theme has the requested view file; if not, it will fallback to loading the view file from the default view directory supplied by Laravel.
Parameters
$view (string) Relative path to view file. Required $data (mixed) Any additional data you'd like to pass along to the view file to be displayed.
Returns
View
Example
Theme::response($view, $data, $status, $headers)
Rendered the defined view in the same manner that Theme::view() does, but allows the means to set a custom status response and header for the rendered page.
Parameters
$view (string) Relative path to view file. Required $data (mixed) Any additional data you'd like to pass along to the view file to be displayed. $status (integer) HTTP status code. $header (array) HTTP headers.
Returns
Response
Example
Start building some awesome themes!
Let's say we have bootstrap theme in our application with the following structure: `
First, we need theme.json manifest file.
Please take note that we need to use Theme::asset() to load our theme asset files. The bootstrap is a theme slug defined in our theme.json file.
In our controller, load the view using the following code:
Now, for our login.blade.php:
Note that we are using @extends('bootstrap::layout') in our login view, where bootstrap is a theme slug defined in our theme.json and layout is our layout file.
Author
License
The Laravel Themes is open-sourced software licensed under the MIT license.
All versions of laravel-themes with dependencies
illuminate/support Version 5.3.*
illuminate/filesystem Version 5.3.*
illuminate/view Version 5.3.*
illuminate/config Version 5.3.*