Add new version in repository
This commit is contained in:
@@ -3,20 +3,24 @@
|
||||
namespace App\Models\Botanic;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
class Genre extends Model
|
||||
{
|
||||
use SoftDeletes, Userstamps;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'botanic_genres';
|
||||
|
||||
public function family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Botanic\Family');
|
||||
return $this->belongsTo('App\Models\Botanic\Family');
|
||||
}
|
||||
|
||||
public function species()
|
||||
{
|
||||
return $this->hasMany('App\Models\Botanic\Specie');
|
||||
return $this->hasMany('App\Models\Botanic\Specie');
|
||||
}
|
||||
|
||||
public function varieties()
|
||||
@@ -24,9 +28,8 @@ class Genre extends Model
|
||||
return $this->hasManyThrough('App\Models\Botanic\Variety', 'App\Models\Botanic\Specie');
|
||||
}
|
||||
|
||||
public function scopeByName($query,$name)
|
||||
public function scopeByName($query, $name)
|
||||
{
|
||||
return $query->where('name', $name);
|
||||
return $query->where('name', $name);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user