Laravel - Change Database Connection for a specific URL?

前端 未结 2 903
野性不改
野性不改 2021-01-03 12:04

I am fairly new to using laravel framework. I have the following requirement. I have a domain - example.com, and its entire code stack is running in laravel. Lets say in the

2条回答
  •  悲哀的现实
    2021-01-03 12:31

    I've made something similar using environments.

    Add a new rule when detecting the environment to parse the URL and change it to the new environment. Then you can add a directory for the new environment where you set up the new database, base URL, etc.

提交回复
热议问题