I'm getting the error, but I can't find why?
Call to undefined method Illuminate\Database\Query\Builder::domains()
The error appears in this two lines of my controller:
$tags = Domains::query()->findOrFail($id);
$tags->domains()->attach($all_tags);
I'm using a pivot table, that's my belongsToMany() relation:
public function domains() { return $this->belongsToMany('App\Models\technical\Domains', 'domain_tag', 'id', 'domains_id'); }
Does anyone see why?
Domainand looking for it'sdomains()? - Ivanka Todorova