Multiple websites with one Laravel installation

爷,独闯天下 提交于 2020-01-03 03:04:49

问题


Initially, I will install Laravel and set it up for a new website called admin.example.com. This will be a simple dashboard just for my use. Next I want to set up www.example1.com with all of the functionality for ecommerce, inventory control, user management, etc. Once that is up and running, I will set up www.example2.com.

Can all of these various websites share the same models, views, and controllers?


回答1:


You should use route groups and domain property for that:

Route::group(['domain' => 'example.com')], function () {
    // All routes for the first domain go here.
}


来源:https://stackoverflow.com/questions/40604788/multiple-websites-with-one-laravel-installation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!