📜  laravel 模型关系与两列匹配 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:37.947000             🧑  作者: Mango

代码示例1
Compoships adds support for multi-columns relationships in Laravel 5's Eloquent.

https://github.com/topclaudy/compoships

It allows you to specify relationships using the following syntax:

public function b()
{
    return $this->hasMany('B', ['key1', 'key2'], ['key1', 'key2']);
}
where both columns have to match.