From 401edadee7edc50abe5820f716ebd39e9c96456a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 12 May 2025 19:38:36 +0530 Subject: [PATCH] Added uom column and updated columnSpan alignments --- app/Filament/Resources/ItemResource.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/Filament/Resources/ItemResource.php b/app/Filament/Resources/ItemResource.php index 4a0a648a3..8d8b06b11 100644 --- a/app/Filament/Resources/ItemResource.php +++ b/app/Filament/Resources/ItemResource.php @@ -111,6 +111,7 @@ class ItemResource extends Resource ->label('Hourly Quantity') ->placeholder('Scan the valid quantity') ->integer() + ->default(1) ->minValue(1) ->reactive() ->afterStateUpdated(function ($state, callable $set, callable $get) { @@ -135,15 +136,22 @@ class ItemResource extends Resource ]) ->hint(fn ($get) => $get('iHourQuanError') ? $get('iHourQuanError') : null) ->hintColor('danger'), - Forms\Components\Textarea::make('description') + Forms\Components\TextInput::make('uom') ->required() - ->placeholder('Scan the valid description'), + ->label('Unit of Measure') + ->placeholder('Scan the valid uom'), + + Forms\Components\TextInput::make('description') + ->placeholder('Scan the valid description') + ->required() + ->minLength(5) + ->columnSpan(['default' => 1, 'sm' => 2]), // ->columnSpanFull(), Forms\Components\TextInput::make('id') ->hidden() ->readOnly(), ]) - ->columns(2), + ->columns(3), ]); } @@ -162,8 +170,14 @@ class ItemResource extends Resource ->sortable() ->searchable(), Tables\Columns\TextColumn::make('hourly_quantity') + ->label('Hourly Quantity') + ->alignCenter() ->numeric() ->sortable(), + Tables\Columns\TextColumn::make('uom') + ->label('Unit of Measure') + ->alignCenter() + ->sortable(), Tables\Columns\TextColumn::make('plant.name') ->sortable() ->searchable(),