I never heard of a multiple-column foreign key before... A foreign key needs to point to another table.
Maybe you can explain what you're trying to achieve with your relationship and what your data structure is?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I got a Problem . I need to do has many relationship with multiple foraign and local key . I googled then i got some solition but none of work for me . maybe problem is im useing mongodb,
i also try this package awobaz/compoships not success :(
here is my code
public function getDetials()
{
return $this->hasMany(Transaction::class, ['UID', 'AID'], ['UID', 'AID']);
}
Please or to participate in this conversation.