Skip to content
Advertisement

Tag: polymorphism

Laravel polymorphic with custom foreign key

I have problem with custom shipmentable_type. My structure looks like this: Now I have in my Transfer model realtion like this: The problem is, that to table shipmentable, to column shipmentable_type is going sth like this now: App/Models/Transfer, but I would like to force to be there ‘transfer’ in this case. Is it possible? Answer From the docs By default,

Advertisement