belongsTo('App\Models\Botanic\Family'); } public function species() { return $this->hasMany('App\Models\Botanic\Specie'); } public function varieties() { return $this->hasManyThrough('App\Models\Botanic\Variety', 'App\Models\Botanic\Specie'); } public function scopeByName($query,$name) { return $query->where('name', $name); } }