简体   繁体   English

Laravel:跨多个应用程序共享相同的框架

[英]Laravel: Sharing same framework across multiple applications

I am planning to have two sub domains to deploy two instances of the same laravel application. 我计划有两个子域来部署同一laravel应用程序的两个实例。 Those will be DEV and TEST. 这些将是DEV和TEST。 Can it be installed like this or do I have to have separate installation for each instance? 可以像这样安装,还是必须为每个实例单独安装?

I think if I can share the framework files, when upgrading, it will be easier than upgrading two. 我想如果我可以共享框架文件,在升级时,它将比升级两个更容易。 Please do share your knowledge if this is a bad idea. 如果这是一个坏主意,请分享您的知识。

Not sure I get this entirely but you are trying to deploy the same project twice (dev & test servers). 不确定我是否完全得到了这个但是你试图两次部署同一个项目(开发和测试服务器)。 If that's the case, then it's very easy. 如果是这样的话,那就很容易了。 It's just one project on two different domain names. 它只是两个不同域名上的一个项目。 You have a couple of options: 你有几个选择:

  1. Put the project on your server and make both domains point to the same folder. 将项目放在您的服务器上,并使两个域指向同一个文件夹。 So dev.com and test.com both point to .../www/project/public . 所以dev.comtest.com都指向.../www/project/public

  2. 2 different instances on 2 different servers. 2个不同服务器上的2个不同实例。 Still easy. 还很容易。 Place your project on bitbucket or github. 将您的项目放在bitbucket或github上。 Go to both server and git pull. 转到服务器和git pull。 When upgrading, you will only upgrade once, on local server, then go to both servers and just git pull again. 升级时,您只需在本地服务器上升级一次,然后再转到两台服务器并再次进行git pull。

Database-wise, you can give them 2 difference databases instances as well. 在数据库方面,您也可以为它们提供2个不同的数据库实例。 Just do it in the .env and they will each point to their respective database. 只需在.env中执行.env ,它们将分别指向各自的数据库。 Still, you only upgrade once, and git pull. 不过,你只升级一次,并且git pull。

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

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