feat: add active and nonactive scopes to RawMaterial model and apply active scope in CuttingService
This commit is contained in:
parent
62341ac50a
commit
577329365a
@ -41,6 +41,18 @@ protected function unitLabel(): Attribute
|
||||
);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function active(Builder $query): void
|
||||
{
|
||||
$query->where('is_active', true);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function nonactive(Builder $query): void
|
||||
{
|
||||
$query->where('is_active', false);
|
||||
}
|
||||
|
||||
#[Scope]
|
||||
protected function kg(Builder $query): void
|
||||
{
|
||||
|
||||
@ -69,6 +69,7 @@ public function getForCreate(): array
|
||||
->with([
|
||||
'rawMaterialPrices:id,raw_material_id,variant,price,stock',
|
||||
])
|
||||
->active()
|
||||
->orderBy('name')
|
||||
->get()
|
||||
->each(function (RawMaterial $rawMaterial) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user