Home > Backend Development > PHP Tutorial > How to merge two different Laravel projects?

How to merge two different Laravel projects?

WBOY
Release: 2016-07-06 13:52:03
Original
1124 people have browsed it

Currently, it needs to be developed based on multiple Laravel5.1 projects with different purposes, using different second-level domain names to distinguish them.
For example, I cloned two Laravel5.1 projects A and B for different purposes from Github, and I need to configure a.xxx.com to access project A and b.xxx.com to access project B.
How to achieve this goal and share the user database? Should I use different folders and two databases, or can the two projects be merged together? If it can be merged, how to do it?

Reply content:

Currently, development needs to be based on multiple Laravel5.1 projects with different uses, and different second-level domain names are used to distinguish them.
For example, I cloned two Laravel5.1 projects A and B for different purposes from Github, and I need to configure a.xxx.com to access project A and b.xxx.com to access project B.
How to achieve this goal and share the user database? Should I use different folders and two databases, or can the two projects be merged together? If it can be merged, how to do it?

The projects themselves are separate, that is, your Project A and Project B should be two unrelated applications, even if they use the same database.

You only need to forward to the corresponding project according to the domain name when configuring apache or nginx,

For example, your A project is located at
F:Zenda

For example, your B project is located at
F:Zendb

Virtual machine configuration

Apache Configuration

<code><VirtualHost *:80>
    ServerAdmin g@godruoyi.com
    # 项目A
    DocumentRoot "F:\Zend\a"
    # 访问项目A的域名
    ServerName a.xxx.com
    ErrorLog "logs/godruoyi_ok.log"
    CustomLog "logs/godruoyi_ok.log" common
    <Directory "F:\Zend\a">
        AllowOverride All
    </Directory>
    <IfModule dir_module>
        # 入口文件
        DirectoryIndex app.php
    </IfModule>
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin g@godruoyi.com
    # 项目B
    DocumentRoot "F:\Zend\b"
    # 访问项目B的域名
    ServerName b.xxx.com
    ErrorLog "logs/godruoyi_ok.log"
    CustomLog "logs/godruoyi_ok.log" common
    <Directory "F:\Zend\b">
        AllowOverride All
    </Directory>
    <IfModule dir_module>
        # 入口文件
        DirectoryIndex app.php
    </IfModule>
</VirtualHost></code>
Copy after login

Configure the host locally

C:WindowsSystem32driversetchosts

127.0.0.1 a.xxx.com b.xxx.com

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template