This commit is contained in:
Lizandro Guarnizo
2026-01-28 14:47:43 -05:00
parent 39e62d67f0
commit 2eef39c2ea
4 changed files with 58 additions and 5 deletions
@@ -17,7 +17,8 @@ use Filament\Forms\Components\{
Select,
DatePicker,
Section,
View
View,
FileUpload,
};
use Filament\Tables\Columns\{
TextColumn,
@@ -102,6 +103,15 @@ class OrdenProduccionResource extends Resource
DatePicker::make('fecha_entrega_estimada')
->required(),
FileUpload::make('imagenes')
->label('Imágenes')
->image()
->multiple()
->directory('ordenes')
->enableReordering()
->columnSpanFull()
->helperText('Sube imágenes relacionadas con la orden.'),
])
->columns(2),
+10
View File
@@ -21,6 +21,16 @@ class OrdenProduccion extends Model
'estado',
'metros_requeridos',
'tela_reservada',
'imagenes',
];
/**
* Casts
*
* @var array
*/
protected $casts = [
'imagenes' => 'array',
];
public function tela()
+4 -4
View File
@@ -49,8 +49,8 @@ class AppServiceProvider extends ServiceProvider
return new PBKDF2Hasher();
});
if (Schema::hasTable('settings')) {
try {
try {
if (Schema::hasTable('settings')) {
$setting = Setting::first();
if ($setting) {
// Aquí se actualizan los valores de configuración de Filament
@@ -58,9 +58,9 @@ class AppServiceProvider extends ServiceProvider
Config::set('filament.brand.colors.primary', $setting->primary_color ?? '#3498db');
Config::set('filament.brand.colors.secondary', $setting->secondary_color ?? '#2ecc71');
}
} catch (\Exception $e) {
Log::error('Error al cargar configuraciones de settings: ' . $e->getMessage());
}
} catch (\Exception $e) {
Log::warning('Skipping settings load in AppServiceProvider: ' . $e->getMessage());
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('orden_produccions', function (Blueprint $table) {
// Store image paths as JSON array
$table->json('imagenes')->nullable()->after('tela_reservada');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('orden_produccions', function (Blueprint $table) {
$table->dropColumn('imagenes');
});
}
};