morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner'); } public function orginalTitleImage() { return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); } public function title_image() { return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); } public function images() { return $this->morphToMany('App\Gallery', 'uploadable'); } public function tags() { return $this->morphToMany('App\Tag', 'taggable'); } public function business() { return $this->belongsTo('App\Business'); } }