Updated item selection logic in StickerMasterResource to return an empty array when no plant is selected #45

Merged
jothi merged 1 commits from ranjith-dev into master 2025-12-01 09:23:49 +00:00

View File

@@ -620,9 +620,7 @@ class StickerMasterResource extends Resource
->options(function (callable $get) {
$plantId = $get('Plant');
return $plantId
? Item::where('plant_id', $plantId)->pluck('code', 'id')
: Item::pluck('code', 'id');
return $plantId ? Item::where('plant_id', $plantId)->pluck('code', 'id') : [];
})
->searchable()
->reactive(),