diff --git a/app/Filament/Pages/TestCertificate.php b/app/Filament/Pages/TestCertificate.php index 222aed15..882daba9 100644 --- a/app/Filament/Pages/TestCertificate.php +++ b/app/Filament/Pages/TestCertificate.php @@ -259,6 +259,7 @@ class TestCertificate extends Page implements HasForms ->label('Sticker ID') ->options(fn (callable $get) => $get('sticker_options') ?? []) ->reactive() + ->searchable() ->afterStateUpdated(function ($state, callable $set) { if (blank($state)) { @@ -435,6 +436,13 @@ class TestCertificate extends Page implements HasForms $set('machine_id', (string) $machineOptions[0]); } $set('sticker_options', $stickerOptions); + $firstStickerId = array_key_first($stickerOptions); + + $set('sticker_id', null); + + if ($firstStickerId !== null) { + $set('sticker_id', (string) $firstStickerId); + } $set('production_order', $record->aufnr); }), TextInput::make('to_serial_number')