I want to check name of that particular company’s shift exist or not?

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('AppModelsShift');

}

public function companies()
{

      return $this->belongsToMany('AppModelsCompany');

}

Source: Laravel

Leave a Reply