定制 vpominchuk/laravel-theme 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vpominchuk/laravel-theme

最新稳定版本:v1.0.1

Composer 安装命令:

composer require vpominchuk/laravel-theme

包简介

Add theme support for your Laravel application

README 文档

README

Laravel Multiple Theme

A package that allows developers to implement multiple theme support to their Laravel applications quickly and easily.

Laravel Theme package allows you to convert your resources/views/ to independent theme.

Laravel Theme allows you to easily add multiple themes to your Laravel application. It provides the ability to create themes. It also offers a theme helper commands to allow for easy switch between themes, list available themes and more...

Laravel Theme is a great way to quickly add theme support to your Laravel application, allowing you to customize the look and feel of your app.

Installation

$ composer require vpominchuk/laravel-theme
$ php artisan vendor:publish --tag=theme-config

Converting your views to a theme

As long as your views located in resources/views/ you can convert them to a theme, just run:

$ php artisan theme:create

and answer some general question.

Available artisan commands

To get list of available artisan commands try:

$ php artisan theme list
Command Description
theme:list Show available themes
theme:info {theme_name} Get theme information
theme:create Create a new theme
theme:activate {theme_name} Activate theme

Switching between themes

You can easily switch between your themes in two different ways:

  1. Using artisan command
$ php artisan theme:activate {theme_name}
  1. Programmatically
use VPominchuk\LaravelThemeSupport\Contracts\ThemeManager;

/** @var ThemeManager $themeManager */
$themeManager = app(ThemeManager::class);
$themeManager->setActiveTheme($systemName); 

Customizing ThemeManager

By default, ThemeManager class stores information about active theme in framework/theme.json file.

{
    "active_theme": "default"
}

In real application you might want to use your own mechanism to store information about active theme.

Follow this documentation to make your own ThemeManager implementation.

Security

If you discover any security related issues, please use the issue tracker.

Credits

Contributing

Feel free to make any suggestions on the issues or create a pull request. I'll be very happy.

See CONTRIBUTING.md for more information about how to contribute.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-31