【发布时间】:2016-01-23 11:51:38
【问题描述】:
考虑下表:
staff
id - integer
name - string
products
id - integer
price - integer
photos
id - integer
path - string
imageable_id - integer
imageable_type - string
Laravel 默认将模型类的名称存储在imageable_type 列中,例如App\Product 和App\Staff。如何手动设置类型值?例如product 和 staff。
【问题讨论】:
标签: laravel polymorphic-associations