I have many to many relationship and I'm trying to check this company's shift name already exist or not in database.
relation is below.
public function shifts()
{
return $this->belongsToMany('App\Models\Shift');
}
public function companies()
{
return $this->belongsToMany('App\Models\Company');
}