up
This commit is contained in:
@@ -17,7 +17,8 @@ use Filament\Forms\Components\{
|
|||||||
Select,
|
Select,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
Section,
|
Section,
|
||||||
View
|
View,
|
||||||
|
FileUpload,
|
||||||
};
|
};
|
||||||
use Filament\Tables\Columns\{
|
use Filament\Tables\Columns\{
|
||||||
TextColumn,
|
TextColumn,
|
||||||
@@ -102,6 +103,15 @@ class OrdenProduccionResource extends Resource
|
|||||||
|
|
||||||
DatePicker::make('fecha_entrega_estimada')
|
DatePicker::make('fecha_entrega_estimada')
|
||||||
->required(),
|
->required(),
|
||||||
|
|
||||||
|
FileUpload::make('imagenes')
|
||||||
|
->label('Imágenes')
|
||||||
|
->image()
|
||||||
|
->multiple()
|
||||||
|
->directory('ordenes')
|
||||||
|
->enableReordering()
|
||||||
|
->columnSpanFull()
|
||||||
|
->helperText('Sube imágenes relacionadas con la orden.'),
|
||||||
])
|
])
|
||||||
->columns(2),
|
->columns(2),
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ class OrdenProduccion extends Model
|
|||||||
'estado',
|
'estado',
|
||||||
'metros_requeridos',
|
'metros_requeridos',
|
||||||
'tela_reservada',
|
'tela_reservada',
|
||||||
|
'imagenes',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Casts
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $casts = [
|
||||||
|
'imagenes' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function tela()
|
public function tela()
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
return new PBKDF2Hasher();
|
return new PBKDF2Hasher();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Schema::hasTable('settings')) {
|
try {
|
||||||
try {
|
if (Schema::hasTable('settings')) {
|
||||||
$setting = Setting::first();
|
$setting = Setting::first();
|
||||||
if ($setting) {
|
if ($setting) {
|
||||||
// Aquí se actualizan los valores de configuración de Filament
|
// 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.primary', $setting->primary_color ?? '#3498db');
|
||||||
Config::set('filament.brand.colors.secondary', $setting->secondary_color ?? '#2ecc71');
|
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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user