From 74c3243c06e0f58eb6034845bda4160706c7c471 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 7 Jul 2025 17:35:58 +0530 Subject: [PATCH] Added reprint functionality in pallet validation --- .../Resources/PalletValidationResource.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/Filament/Resources/PalletValidationResource.php b/app/Filament/Resources/PalletValidationResource.php index 240b9ed..c2f68dd 100644 --- a/app/Filament/Resources/PalletValidationResource.php +++ b/app/Filament/Resources/PalletValidationResource.php @@ -481,16 +481,21 @@ class PalletValidationResource extends Resource Tables\Actions\Action::make('reprint_pallet') ->label('Re-Print Pallet QR') ->form([ - Select::make('plant') - ->options(Plant::pluck('name', 'id')->toArray()) + Forms\Components\Section::make() + ->schema([ + Forms\Components\Select::make('plant') ->label('Select Plant') + ->options(Plant::pluck('name', 'id')->toArray()) ->required() - ->reactive(), - Select::make('pallet_list') + ->reactive() + ->columnSpan(2), + + Forms\Components\Select::make('pallet_list') ->label('Select Pallet') ->searchable() ->required() ->reactive() + ->columnSpan(1) ->options(function (callable $get) { $plantId = $get('plant'); @@ -501,14 +506,15 @@ class PalletValidationResource extends Resource return PalletValidation::query() ->where('plant_id', $plantId) ->whereNotNull('pallet_number') - ->where('pallet_number','!=', '') + ->where('pallet_number', '!=', '') ->select('pallet_number') ->distinct() ->orderBy('pallet_number') ->pluck('pallet_number', 'pallet_number') ->toArray(); - }), - + }), + ]) + ->columns(['default' => 1, 'sm' => 3]), ]) ->action(function (array $data) { $selectedPalletNumber = $data['pallet_list'];