27 lines
482 B
PHP
27 lines
482 B
PHP
<?php
|
|
|
|
namespace App\Models\Botanic;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Specie extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
protected $table = 'botanic_species';
|
|
|
|
public function Genre()
|
|
{
|
|
return $this->belongsTo('App\Models\Botanic\Genre');
|
|
}
|
|
|
|
public function Varieties()
|
|
{
|
|
return $this->hasMany('App\Models\Botanic\Variety');
|
|
}
|
|
|
|
public function scopeByName($query,$name)
|
|
{
|
|
return $query->where('name', $name);
|
|
}
|
|
|
|
} |