diff --git a/app/Filament/Resources/InventarioPrendaResource/RelationManagers/DistribucionesRelationManager.php b/app/Filament/Resources/InventarioPrendaResource/RelationManagers/DistribucionesRelationManager.php index e8ea125..bdfb5f6 100644 --- a/app/Filament/Resources/InventarioPrendaResource/RelationManagers/DistribucionesRelationManager.php +++ b/app/Filament/Resources/InventarioPrendaResource/RelationManagers/DistribucionesRelationManager.php @@ -20,7 +20,12 @@ class DistribucionesRelationManager extends RelationManager Forms\Components\Select::make('bodega_id')->relationship('bodega', 'nombre')->required(), Forms\Components\Select::make('color_id')->relationship('color', 'name')->nullable(), Forms\Components\Select::make('size_id')->relationship('size', 'name')->nullable(), - Forms\Components\TextInput::make('cantidad')->numeric()->required()->minValue(1), + Forms\Components\TextInput::make('cantidad') + ->numeric() + ->required() + ->minValue(1) + ->default(fn() => $this->getOwnerRecord()?->cantidad_disponible ?? 0) + ->maxValue(fn() => $this->getOwnerRecord()?->cantidad_disponible ?? 0), ]); }