rename models and associates, isolate botanic with shop
This commit is contained in:
22
app/Models/Botanic/Family.php
Normal file
22
app/Models/Botanic/Family.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Botanic;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Family extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'botanic_families';
|
||||
|
||||
public function genres()
|
||||
{
|
||||
return $this->hasMany('App\Models\Botanic\Genre');
|
||||
}
|
||||
|
||||
public function scopeByName($query,$name)
|
||||
{
|
||||
return $query->where('name', $name);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user