PHP code example of pierresilva / laravel-themes
1. Go to this page and download the library: Download pierresilva/laravel-themes library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pierresilva / laravel-themes example snippets
pierresilva\Themes\ThemesServiceProvider::class,
'Theme' => pierresilva\Themes\Facades\Theme::class,
php artisan vendor:publish --provider="pierresilva\Themes\ThemesServiceProvider"
'active' => 'default'
php artisan generate:theme themeslug
echo Theme::getProperty('theme::property_key', 'default value if nothing is returned');
Theme::setProperty('theme::property_key', 'new value to be set');
...
'active' => 'foobar'
...
use Theme;
...
public function __construct()
{
Theme::setActive('foobar');
}
...
$themes = Theme::all();
Theme::setActive('bootstrap-theme');
$activeTheme = Theme::getActive();
$foo = 'bar';
return Theme::view('welcome', compact('foo'));
$posts = Post::orderBy('published', 'desc')->get();
return Theme::response('blog.rss', compact('posts'), 200, [
'Content-Type' => 'application/atom+xml; charset=UTF-8'
]);
public function getLogin()
{
return Theme::view('auth.login');
}