import type improvement

This commit is contained in:
Cihan Şentürk
2023-05-26 13:26:48 +03:00
committed by GitHub
parent 99ed3c15a0
commit 9d48e54430
2 changed files with 20 additions and 9 deletions

View File

@ -94,6 +94,15 @@ class Item extends Model
return $query->whereNotNull($price_type . '_price');
}
public function scopeType($query, $type)
{
if (empty($type)) {
return $query;
}
return $query->whereIn('type', $type);
}
/**
* Get the item id.
*