cleaning day
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
namespace App\Models\Botanic;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
|
||||
@@ -14,19 +17,19 @@ class Genre extends Model
|
||||
|
||||
protected $table = 'botanic_genres';
|
||||
|
||||
public function family()
|
||||
public function family(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo('App\Models\Botanic\Family');
|
||||
return $this->belongsTo(Family::class);
|
||||
}
|
||||
|
||||
public function species()
|
||||
public function species(): HasMany
|
||||
{
|
||||
return $this->hasMany('App\Models\Botanic\Specie');
|
||||
return $this->hasMany(Specie::class);
|
||||
}
|
||||
|
||||
public function varieties()
|
||||
public function varieties(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough('App\Models\Botanic\Variety', 'App\Models\Botanic\Specie');
|
||||
return $this->hasManyThrough(Variety::class, Specie::class);
|
||||
}
|
||||
|
||||
public function scopeByName($query, $name)
|
||||
|
||||
Reference in New Issue
Block a user