diff --git a/app/Models/RawMaterial.php b/app/Models/RawMaterial.php index 299d748..793b471 100644 --- a/app/Models/RawMaterial.php +++ b/app/Models/RawMaterial.php @@ -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 { diff --git a/app/Services/Admin/Manage/CuttingService.php b/app/Services/Admin/Manage/CuttingService.php index 988ba18..36efe5c 100644 --- a/app/Services/Admin/Manage/CuttingService.php +++ b/app/Services/Admin/Manage/CuttingService.php @@ -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) {