Add new version in repository
This commit is contained in:
@@ -3,25 +3,35 @@
|
||||
namespace App\Models\Botanic;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
use Rinvex\Tags\Traits\Taggable;
|
||||
|
||||
class Specie extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'botanic_species';
|
||||
use SoftDeletes, Taggable, UserStamps;
|
||||
|
||||
public function Genre()
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'botanic_species';
|
||||
|
||||
public function Genre()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Botanic\Genre');
|
||||
return $this->belongsTo('App\Models\Botanic\Genre');
|
||||
}
|
||||
|
||||
public function Varieties()
|
||||
{
|
||||
return $this->hasMany('App\Models\Botanic\Variety');
|
||||
return $this->hasMany('App\Models\Botanic\Variety');
|
||||
}
|
||||
|
||||
public function scopeByName($query,$name)
|
||||
public function Articles()
|
||||
{
|
||||
return $query->where('name', $name);
|
||||
return $this->morphMany('App\Models\Shop\Article', 'product');
|
||||
}
|
||||
|
||||
}
|
||||
public function scopeByName($query, $name)
|
||||
{
|
||||
return $query->where('name', $name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user