Updated item selection logic in StickerMasterResource to return an empty array when no plant is selected
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 27s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 2m6s
Laravel Pint / pint (pull_request) Failing after 2m7s

This commit is contained in:
dhanabalan
2025-12-01 14:53:15 +05:30
parent 91deb448ef
commit 035e6cd560

View File

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