larapkg/lumen-discovery 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

larapkg/lumen-discovery

最新稳定版本:1.0.1

Composer 安装命令:

composer require larapkg/lumen-discovery

包简介

Add package discovery to your lumen application.

README 文档

README

Add package discovery to your lumen application.

Installation

Require via composer:

composer require larapkg/lumen-discovery

Open your base composer.json file in your project root and add the following to the end of the file:

"scripts": {
        "post-autoload-dump": [
            "LaraPkg\\LumenDiscover\\Events\\Dump::post"
        ]
    }

The above will enable the packages' ability to discover and cache your providers and aliases.

Now simply register the packages service provider in your bootstrap/app.php file:

$app->register(\LaraPkg\LumenDiscover\ServiceProvider::class);

With the above complete you can now build packages to your hearts content and not worry about how they register into your lumen app.

To make a package you write compatible with this package, you will need to add the following to your packages composer json:

Example from barryvdh/laravel-debugbar

"extra": {
    "laravel": {
        "providers": [
            "Barryvdh\\Debugbar\\ServiceProvider"
        ],
        "aliases": {
            "Debugbar": "Barryvdh\\Debugbar\\Facade"
        }
    }
},

With this package you can use laravel or lumen interchangeably but remember if you want to use your packages with Laravel you should stick with the laravel naming convention.

That's it, now you can pull laravel packages into your lumen app and watch them self register, or you can build your own packages that will also self-register. Have fun!

The base repository this work is off of is composer/composer and it is well worth a read.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-18