diff --git a/app/Filament/Resources/TelaResource.php b/app/Filament/Resources/TelaResource.php index 73601fd..7ff494e 100644 --- a/app/Filament/Resources/TelaResource.php +++ b/app/Filament/Resources/TelaResource.php @@ -39,8 +39,7 @@ class TelaResource extends Resource ->required() ->helperText('Ej: Algodón, Poliéster, Denim'), - FileUpload::make('foto')->image()->directory('telas')->disk('public')->visibility('public')->maxSize(1024)->imageEditor()->imageEditorAspectRatios(['16:9','4:3','1:1'])->helperText('Selecciona una imagen de la tela (máx. 1MB)')->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp'])->downloadable()->openable()->nullable() - , + ColorPicker::make('color')->default('#000000'), @@ -87,7 +86,7 @@ class TelaResource extends Resource { return $table ->columns([ - Tables\Columns\ImageColumn::make('foto')->disk('public'), + Tables\Columns\TextColumn::make('codigo')->searchable(), Tables\Columns\TextColumn::make('tipo')->searchable(), Tables\Columns\TextColumn::make('color')->searchable(), diff --git a/app/Models/Tela.php b/app/Models/Tela.php index b02c1d8..fb85312 100644 --- a/app/Models/Tela.php +++ b/app/Models/Tela.php @@ -9,7 +9,6 @@ class Tela extends Model protected $fillable = [ 'codigo', 'tipo', - 'foto', 'color', 'proveedor_id', 'metros_comprados', @@ -21,7 +20,6 @@ class Tela extends Model ]; protected $casts = [ - 'foto' => 'string', 'valor_total' => 'decimal:2', 'costo_por_metro' => 'decimal:2', ]; diff --git a/database/migrations/2026_01_28_200100_drop_foto_from_telas_table.php b/database/migrations/2026_01_28_200100_drop_foto_from_telas_table.php new file mode 100644 index 0000000..a60030f --- /dev/null +++ b/database/migrations/2026_01_28_200100_drop_foto_from_telas_table.php @@ -0,0 +1,36 @@ +dropColumn('foto'); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('telas', function (Blueprint $table) { + if (! Schema::hasColumn('telas', 'foto')) { + $table->string('foto')->nullable()->after('tipo'); + } + }); + } +};