In L3 there was great thing - packages. They could have own routes and worked as plugins and made software more modular. How to achieve this in L4? I see packages little different from bundles.
Thank You!
Bundle 是 Laravel 3 的特定包装,很容易添加一个包,但不是标准。
Laravel 4 更加模块化,因为它接受来自所有 php 社区的包。它使用标准作为包管理器Composer,并且 Laravel 4 本身作为包进行管理。
你只需要像这样创建一个 composer.json 文件:
{
"require": {
"laravel/framework": "4.0.*"
},
"require-dev": {
"phpunit/phpunit": "3.7.*",
"mockery/mockery": "dev-master@dev",
"sebastian/phpcpd": "1.4.*"
}
}
并执行composer update
. 您项目的所有依赖项都将按照您在此文件中指定的版本进行安装。这确实是为团队管理大量库的最佳模式。
捆绑和包裹非常相似,礼品包装和运输方式发生了变化,但仅此而已。