简体   繁体   English

laravel 5. *-包驱动的开发-最佳实践

[英]laravel 5.* - package driven development - best practices

this is not a code question about laravel 5.*, it's more like to know if you guys develop your applications using packages ("package driven development" ? Not sure if this is the right definition). 这不是关于laravel 5. *的代码问题,它更像是要知道你们是否使用包来开发应用程序(“包驱动开发”?不确定这是否是正确的定义)。

What I mean is: Instead of building an application and create controllers in app/Http/Controllers/, you wrap everything in a package and then 'require' that package using composer (like a wordpress plugin). 我的意思是:不是在app / Http / Controllers /中构建应用程序并创建控制器,而是将所有内容包装在一个包中,然后使用composer(如wordpress插件)“要求”该包。

I'm trying to think in a way to isolate the core Laravel from my specific application and save time later when it's time to upgrade when a new Laravel version is available. 我正在尝试以某种方式将核心Laravel与我的特定应用程序隔离开,并在需要新Laravel版本时进行升级时节省以后的时间。

In my case I'm having some issues moving from version 5.2 to 5.3 because I have some customization in the registration and login process - It might be because I'm not using the right approach to write the code (patterns), so I'd like to hear from more experienced Laravel developers. 就我而言,从5.2版到5.3版时我遇到了一些问题,因为我在注册和登录过程中进行了一些自定义-可能是因为我没有使用正确的方法编写代码(模式),所以我希望听到更多经验丰富的Laravel开发人员的来信。

Thanks! 谢谢!

The great thing about Laravel, there's almost always a package for what you want to do. Laravel的优点在于,几乎总会有您想要做的事情打包。 You can either create your packages as packages on composer, or you can install a module package and create them as modules. 您可以将软件包创建为composer上的软件包,也可以安装模块软件包并将其创建为模块。

For my projects I tend to use caffeinated/modules . 对于我的项目,我倾向于使用caffeinated / modules I've tried a few and IMO it's the easiest to use. 我已经尝试了一些,IMO是最简单的使用方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM