[WIP] Add some classes

This commit is contained in:
Ludovic CANDELLIER
2020-04-25 01:06:04 +02:00
parent e0fecd1a6e
commit 516ec2232e
36 changed files with 814 additions and 131 deletions

View File

@@ -19,6 +19,11 @@ class Genre extends Model
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);