Use multiple Database Tables in single model in Lumen Framework

时间:2015-06-26 10:25:06

标签: php laravel lumen

I have these Database tables:

country_US
country_FR
country_EN
country_NL
country_ES

How can I create a single model for above tables? Database structure of all these tables are the same.

What can be the workaround for this scenario in Lumen Framework?

1 个答案:

答案 0 :(得分:0)

我不知道有这么糟糕的数据库设计的原因。理想的情况是只有一个表格带有“语言”列。

无论如何,一种肮脏的方式是覆盖getTable()方法:

<div id="multipleSelect"></div>

getTable()方法是Laravel用于确定应该用于模型的表的方法。如果覆盖它,则可以控制将使用哪个表。