【发布时间】:2021-09-29 13:29:34
【问题描述】:
我有多对多关系,我正在尝试检查这家公司的班次名称是否已存在于数据库中。
关系如下。
public function shifts()
{
return $this->belongsToMany('App\Models\Shift');
}
public function companies()
{
return $this->belongsToMany('App\Models\Company');
}
【问题讨论】:
-
有什么问题,你的代码在哪里,你试过什么?你写,我们帮忙,我们不给你写代码。
标签: php database laravel eloquent eloquent-relationship