简体   繁体   English

Laravel依赖包开发

[英]Laravel package development with dependacy package

Background 背景

I am new to the Laravel Package. 我是Laravel软件包的新手。

In my Laravel application I usually run the following command in order to install Bican Rokes, change the config files, etc... 在我的Laravel应用程序中,我通常运行以下命令以安装Bican Rokes,更改配置文件等。

php artisan make:auth 
php artisan migrate

Objective 目的

However, this process is tedious, so I was wondering if it is possible to create a package capable of automatizing the process. 但是,此过程很繁琐,所以我想知道是否有可能创建一个能够使该过程自动化的软件包。

What I tried 我尝试了什么

To achieve this I read the Laravel documentation, which teaches how to create packages, but I was unable to understand if this is possible and if it yes, how it should be done. 为此,我阅读了Laravel文档,该文档教导了如何创建软件包,但是我无法理解这是否可行,如果可以,应该如何完成。

Questions 问题

  1. Can a package be used to automate this behaviour? 可以使用软件包来自动执行此行为吗?
  2. If yes, can you provide it? 如果可以,可以提供吗?
  3. If not, can you explain to me what a package really is? 如果没有,您能给我解释一下什么是包裹吗? (links to tutorials are welcome) (欢迎链接到教程)
  4. If I cannot use a package, is there any other way of doing this? 如果我不能使用包裹,还有其他方法吗?

I am not pushing the sale of anything, nor do I know this guy. 我不推销任何东西,也不认识这个人。 But this tutorial is a pretty good starting point for laravel. 但是,本教程是laravel的一个很好的起点。 Laravel Tutorial Series Laravel教程系列

if a separate package should be created or not will depend on volume of work you want to accomplish. 是否应该创建单独的程序包取决于您要完成的工作量。 a starting point can be a custom console command, and from with-in that command, you can call multiple other commands.. And from their you can extend it to do other things like editing files etc. If you don't know how to write a console command in Laravel, here is the link to docs: https://laravel.com/docs/5.2/artisan#writing-commands 起点可以是自定义控制台命令,并且可以随该命令一起调用多个其他命令。从它们可以扩展它以执行其他操作,例如编辑文件等。如果您不知道如何在Laravel中编写控制台命令,这里是文档的链接: https ://laravel.com/docs/5.2/artisan#writing-commands

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

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