PHPackages                             hongyukeji/laravel-theme - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hongyukeji/laravel-theme

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hongyukeji/laravel-theme
========================

v2.1.0(5y ago)21271MITPHPPHP &gt;=5.3.0

Since May 28Pushed 5y agoCompare

[ Source](https://github.com/hongyukeji/laravel-theme)[ Packagist](https://packagist.org/packages/hongyukeji/laravel-theme)[ RSS](/packages/hongyukeji-laravel-theme/feed)WikiDiscussions master Synced today

READMEChangelog (5)DependenciesVersions (9)Used By (0)

 laravel-theme
===============

[](#-laravel-theme-)

 Laravel 主题模板功能, 这可能是我用过最优雅的laravel主题扩展

Installing
----------

[](#installing)

```
$ composer require hongyukeji/laravel-theme
```

```
$ php artisan vendor:publish --provider="Hongyukeji\LaravelTheme\ThemeServiceProvider"
```

Usage
-----

[](#usage)

### 特点

[](#特点)

> 利用 View::addNamespace() 和 View::prependNamespace() 实现主题模板功能

### 使用

[](#使用)

```
// 1. 在 config/themes.php 中 添加 templates, 如:
'templates' => [
    'frontend' => [
        'path' => 'frontend',
        'template' => 'default',
        'default' => 'default',
    ],
],

// 2. 在控制器中使用:
public function index()
{
    return view('frontend::index.index');
}

// 3. 在视图目录新建frontend目录和对应的index(frontend => 终端, default => 主题):
resources/views/frontend
resources/views/frontend/default
resources/views/frontend/default/index
resources/views/frontend/default/index/index.blade.php

```

### templates 配置说明

[](#templates-配置说明)

- path 为每个终端模板目录路径
- template 为使用模板的目录
- default 为默认模板目录, 即找不到template模板对应的目录文件, 会自动在该参数定义的目录去查找

### 助手函数你可能会需要

[](#助手函数你可能会需要)

- get\_template\_dir 获取给定路径下的所有目录

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/hongyukeji/laravel-theme/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/hongyukeji/laravel-theme/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~31 days

Total

8

Last Release

2100d ago

Major Versions

v1.2.2 → v2.0.02020-08-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/484917e0c99c9779961352578c18bae13504567d6ec43cc3c594b3e447aad436?d=identicon)[hongyukeji](/maintainers/hongyukeji)

### Embed Badge

![Health badge](/badges/hongyukeji-laravel-theme/health.svg)

```
[![Health](https://phpackages.com/badges/hongyukeji-laravel-theme/health.svg)](https://phpackages.com/packages/hongyukeji-laravel-theme)
```

###  Alternatives

[strategery/magento2-infinitescroll

Magento2 InfiniteScroll module to load the next catalog page or results when scrolling down a page.

53246.2k1](/packages/strategery-magento2-infinitescroll)[web-id/laravel-playwright

Laravel Playwright Boilerplate

8315.5k](/packages/web-id-laravel-playwright)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
