PHPackages                             y80x86ol/laravel-modules - 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. [Framework](/categories/framework)
4. /
5. y80x86ol/laravel-modules

ActiveLibrary[Framework](/categories/framework)

y80x86ol/laravel-modules
========================

modules for laravel5

110PHP

Since Sep 23Pushed 7y ago1 watchersCompare

[ Source](https://github.com/y80x86ol/laravel-modules)[ Packagist](https://packagist.org/packages/y80x86ol/laravel-modules)[ RSS](/packages/y80x86ol-laravel-modules/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-modules
---------------

[](#laravel-modules)

基于laravel5写的模块扩展，安装后可以进行模块化开发

安装
--

[](#安装)

在你的项目中的composer.json文件中添加require:

```

"require": {
        "y80x86ol/laravel-modules": "0.1.x-dev"
    },

```

在项目中的config/app.php中添加providers服务提供者

`Y80x86ol\LaravelModules\LaravelModulesServiceProvider::class,`

然后执行`composer update`下载和更新模块

使用
--

[](#使用)

1、在app下新建文件夹Modules

2、在app/Modules中新建routes.php主路由文件

3、建立你的模块，在app/Modules中新建Example文件夹，模块名即为Example

4、在app/Modules/Example建立如下文件和文件夹，如下：

```

Http\
    Controllers\    控制器
    Models\         模型
    Views\          视图
Public\             静态资源
Migrations\         数据库迁移
Translations\       国际化
routes.php          路由
example.php         模块配置文件[备注：该文件名字请和模块名字一下，单词全部小写]

```

5、怎么样，上面的文件夹和文件是不是很熟悉，对了，你可以按照Laravel5的开发方式进行开发了，书写代码都是一样的

6、当你在增加一些静态资源或者数据库迁移或者国际化文件的时候，请在命令窗口执行 `php artisan vendor:publish` 进行相关文件的发布

注意事项
----

[](#注意事项)

1、模块中的路由写法最好采用路由组的写法，例如：

```

Route::group(['namespace' => 'App\Modules\Example\Http\Controllers'], function() {
    // 控制器在「App\Modules\Example\Http\Controllers」命名空间

    Route::get('example/route', [
        'as' => 'profile', 'uses' => 'ExampleController@route'
    ]);

    Route::get('example/config', [
        'as' => 'profile', 'uses' => 'ExampleController@config'
    ]);
});

```

演示模块
----

[](#演示模块)

模块中的test文件夹中是附带有两个演示模块，你可以直接拷贝代码内容到app/Modules中

访问如下url地址，可以看到模块效果

`example.com/example/` 或者 `example.com/index.php/example`，这个取决于你的项目是否开启了去除index.php的配置

所有演示路由地址见模块中的routes.php文件

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/06484b32b8d882941bc0af56d8a72c9a3f9f7932be9407c2bec1c34c93f618f3?d=identicon)[y80x86ol](/maintainers/y80x86ol)

---

Top Contributors

[![y80x86ol](https://avatars.githubusercontent.com/u/6071803?v=4)](https://github.com/y80x86ol "y80x86ol (19 commits)")

### Embed Badge

![Health badge](/badges/y80x86ol-laravel-modules/health.svg)

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M831](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[pinguo/php-msf

Pinguo Micro Service Framework For PHP

1.7k4.2k](/packages/pinguo-php-msf)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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