Update ShowConfiguracion.php
This commit is contained in:
@@ -90,38 +90,38 @@ class ShowConfiguracion extends Component
|
||||
//dd($consulta_configuraciones);
|
||||
if (empty($this->nombre) && empty($this->slogan) && empty($this->color_boton)) {
|
||||
|
||||
$this->nombre = $consulta_configuracion->nombre;
|
||||
$this->slogan = $consulta_configuracion->slogan;
|
||||
$this->color_boton = $consulta_configuracion->color_boton;
|
||||
$this->url_logo = $consulta_configuracion->url_logo;
|
||||
$this->color_barra = $consulta_configuracion->color_barra;
|
||||
$this->color_menu = $consulta_configuracion->color_menu;
|
||||
$this->nombre = $consulta_configuracion->nombre;
|
||||
$this->slogan = $consulta_configuracion->slogan;
|
||||
$this->color_boton = $consulta_configuracion->color_boton;
|
||||
$this->url_logo = $consulta_configuracion->url_logo;
|
||||
$this->color_barra = $consulta_configuracion->color_barra;
|
||||
$this->color_menu = $consulta_configuracion->color_menu;
|
||||
|
||||
//top
|
||||
$this->top_1 = $consulta_configuracion->top_1;
|
||||
$this->top_2 = $consulta_configuracion->top_2;
|
||||
$this->top_3 = $consulta_configuracion->top_3;
|
||||
$this->top_4 = $consulta_configuracion->top_4;
|
||||
$this->top_5 = $consulta_configuracion->top_5;
|
||||
$this->top_6 = $consulta_configuracion->top_6;
|
||||
$this->top_7 = $consulta_configuracion->top_7;
|
||||
$this->top_8 = $consulta_configuracion->top_8;
|
||||
$this->top_9 = $consulta_configuracion->top_9;
|
||||
$this->top_10 = $consulta_configuracion->top_10;
|
||||
$this->top_1 = $consulta_configuracion->top_1;
|
||||
$this->top_2 = $consulta_configuracion->top_2;
|
||||
$this->top_3 = $consulta_configuracion->top_3;
|
||||
$this->top_4 = $consulta_configuracion->top_4;
|
||||
$this->top_5 = $consulta_configuracion->top_5;
|
||||
$this->top_6 = $consulta_configuracion->top_6;
|
||||
$this->top_7 = $consulta_configuracion->top_7;
|
||||
$this->top_8 = $consulta_configuracion->top_8;
|
||||
$this->top_9 = $consulta_configuracion->top_9;
|
||||
$this->top_10 = $consulta_configuracion->top_10;
|
||||
|
||||
$this->premio_1 = $consulta_configuracion->premio_1;
|
||||
$this->premio_2 = $consulta_configuracion->premio_2;
|
||||
$this->premio_3 = $consulta_configuracion->premio_3;
|
||||
$this->premio_4 = $consulta_configuracion->premio_4;
|
||||
$this->premio_5 = $consulta_configuracion->premio_5;
|
||||
$this->premio_6 = $consulta_configuracion->premio_6;
|
||||
$this->premio_7 = $consulta_configuracion->premio_7;
|
||||
$this->premio_8 = $consulta_configuracion->premio_8;
|
||||
$this->premio_9 = $consulta_configuracion->premio_9;
|
||||
$this->premio_10 = $consulta_configuracion->premio_10;
|
||||
$this->premio_1 = $consulta_configuracion->premio_1;
|
||||
$this->premio_2 = $consulta_configuracion->premio_2;
|
||||
$this->premio_3 = $consulta_configuracion->premio_3;
|
||||
$this->premio_4 = $consulta_configuracion->premio_4;
|
||||
$this->premio_5 = $consulta_configuracion->premio_5;
|
||||
$this->premio_6 = $consulta_configuracion->premio_6;
|
||||
$this->premio_7 = $consulta_configuracion->premio_7;
|
||||
$this->premio_8 = $consulta_configuracion->premio_8;
|
||||
$this->premio_9 = $consulta_configuracion->premio_9;
|
||||
$this->premio_10 = $consulta_configuracion->premio_10;
|
||||
|
||||
$this->img_top = $consulta_configuracion->img_top;
|
||||
$this->mensaje_top = $consulta_configuracion->mensaje_top;
|
||||
$this->img_top = $consulta_configuracion->img_top;
|
||||
$this->mensaje_top = $consulta_configuracion->mensaje_top;
|
||||
|
||||
//msj
|
||||
|
||||
@@ -136,7 +136,7 @@ class ShowConfiguracion extends Component
|
||||
$this->clave_6 = $consulta_configuracion->clave_6;
|
||||
|
||||
$this->iptv = $consulta_configuracion->iptv;
|
||||
$this->notificacion = $consulta_configuracion->hora;
|
||||
$this->notificacion = $consulta_configuracion->hora;
|
||||
}
|
||||
|
||||
return view('livewire.show-configuracion', [
|
||||
@@ -145,21 +145,27 @@ class ShowConfiguracion extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function updateCatalogo()
|
||||
{
|
||||
$configuracion = Configuracione::orderby('id', 'desc')->first();
|
||||
|
||||
if ($this->catalogo) {
|
||||
// Generar un nombre aleatorio para el nuevo catálogo
|
||||
$nombreCatalogo = Str::random(10) . '.pdf';
|
||||
|
||||
// Almacenar el nuevo archivo y obtener su URL
|
||||
$urlCatalogo = $this->catalogo->storeAs('photos', $nombreCatalogo);
|
||||
} else {
|
||||
$urlCatalogo = $configuracion->catalogo;
|
||||
// Mantener la URL del archivo anterior
|
||||
$urlCatalogo = $this->consulta_configuracion->catalogo;
|
||||
}
|
||||
|
||||
$configuracion->catalogo = $urlCatalogo;
|
||||
$configuracion->save();
|
||||
// Actualizar el campo de catálogo en la configuración
|
||||
$this->consulta_configuracion->catalogo = $urlCatalogo;
|
||||
$this->consulta_configuracion->save();
|
||||
|
||||
$this->alert('success', 'Catalogo actualizados correctamente!', [
|
||||
// Mostrar un mensaje de éxito
|
||||
$this->alert('success', '¡Catálogo actualizado correctamente!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
}
|
||||
@@ -177,7 +183,7 @@ class ShowConfiguracion extends Component
|
||||
$consulta->titulo = trim($this->titulo_noti);
|
||||
$consulta->descripcion = trim($this->descripcion_noti);
|
||||
$consulta->estado = true;
|
||||
$consulta->todos = $this->destinatario_noti == 'todos' || !$this->destinatario_noti ? true : false;
|
||||
$consulta->todos = $this->destinatario_noti == 'todos' || !$this->destinatario_noti ? true : false;
|
||||
$consulta->save();
|
||||
|
||||
$this->alert('success', 'Notificacion creada exitosamente!', [
|
||||
@@ -269,7 +275,7 @@ class ShowConfiguracion extends Component
|
||||
}
|
||||
|
||||
$guardar = new slider;
|
||||
$guardar->slider = $url_slider;
|
||||
$guardar->slider = $url_slider;
|
||||
$guardar->save();
|
||||
|
||||
$this->slider = '';
|
||||
|
||||
Reference in New Issue
Block a user