fixes
This commit is contained in:
@@ -47,4 +47,18 @@ class Specie extends Model implements HasMedia
|
||||
{
|
||||
return $query->where($this->table.'.name', $name);
|
||||
}
|
||||
|
||||
public function scopeByTag($query, $tagId)
|
||||
{
|
||||
return $tagId ? $query->whereHas('tags', function ($query) use ($tagId) {
|
||||
$query->byId($tagId);
|
||||
}) : $query;
|
||||
}
|
||||
|
||||
public function scopeByTags($query, $tags)
|
||||
{
|
||||
return $tags ? $query->whereHas('tags', function ($query) use ($tags) {
|
||||
$query->byIds($tags);
|
||||
}) : $query;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user