catalogo - falta migracion
This commit is contained in:
@@ -80,6 +80,8 @@ class ShowConfiguracion extends Component
|
||||
public $descripcion_noti;
|
||||
public $destinatario_noti;
|
||||
|
||||
public $catalogo;
|
||||
|
||||
public function render()
|
||||
{
|
||||
//$consulta = Configuracione::with('usuario')->orderby('id','desc');
|
||||
@@ -95,7 +97,7 @@ class ShowConfiguracion extends Component
|
||||
$this->color_barra = $consulta_configuracion->color_barra;
|
||||
$this->color_menu = $consulta_configuracion->color_menu;
|
||||
|
||||
//top
|
||||
//top
|
||||
$this->top_1 = $consulta_configuracion->top_1;
|
||||
$this->top_2 = $consulta_configuracion->top_2;
|
||||
$this->top_3 = $consulta_configuracion->top_3;
|
||||
@@ -143,6 +145,24 @@ class ShowConfiguracion extends Component
|
||||
]);
|
||||
}
|
||||
|
||||
public function updateCatalogo()
|
||||
{
|
||||
$configuracion = Configuracione::first();
|
||||
|
||||
if ($this->catalogo) {
|
||||
$nombreCatalogo = Str::random(10) . '.pdf';
|
||||
$urlCatalogo = $this->catalogo->storeAs('storage', $nombreCatalogo);
|
||||
} else {
|
||||
$urlCatalogo = $configuracion->catalogoPDF;
|
||||
}
|
||||
|
||||
$configuracion->catalogoPDF = $urlCatalogo;
|
||||
$configuracion->save();
|
||||
|
||||
$this->alert('success', 'Catalogo actualizados correctamente!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
}
|
||||
|
||||
public function guardarNoti()
|
||||
{
|
||||
@@ -164,7 +184,7 @@ class ShowConfiguracion extends Component
|
||||
'position' => 'top'
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$this->titulo_noti = null;
|
||||
$this->descripcion_noti = null;
|
||||
$this->destinatario_noti = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="h-full w-full md:my-2">
|
||||
<div class=" fixed backdrop-blur-sm bg-white/70 left-0 bottom-0 top-0 right-0 h-full z-40" wire:loading
|
||||
wire:target="guardar,guardarSlider,slider,cancelarSlider,deleteSlider,confirmed,guardarNoti">
|
||||
wire:target="guardar,guardarSlider,catalogo,slider,cancelarSlider,deleteSlider,confirmed,guardarNoti">
|
||||
<div class="grid h-full place-items-center ">
|
||||
<div class="max-w-xs">
|
||||
<img src="./img/loading.gif" alt="" class="w-full text-center">
|
||||
@@ -590,14 +590,53 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="lg:col-span-1 mb-4 text-center">
|
||||
<div class="bg-white grid grid-cols-1 lg:grid-cols-1 text-center rounded-xl py-4 px-8 shadow-md xl:mx-10 mb-8">
|
||||
|
||||
<button wire:click="eliminarCache"
|
||||
class=" mx-auto inline-flex justify-center rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-red-500 hover:bg-red-700 focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Eliminar
|
||||
<div class="mb-4 flex items-center flex-col gap-4 md:gap-10 lg:gap-20 xl:gap-32">
|
||||
|
||||
<div class="w-full md:w-auto">
|
||||
<label for="catalogo"
|
||||
class="cursor-pointer md:w-auto rounded-lg text-[#ffffff] justify-between px-4 md:px-8 py-2 font-semibold text-lg duration-150 drop-shadow-lg flex bg-gray-500 items-center gap-2 md:gap-4">
|
||||
Catalogo
|
||||
|
||||
@if ($catalogo)
|
||||
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
||||
stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||
</svg>
|
||||
@else
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
|
||||
stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12">
|
||||
</path>
|
||||
</svg>
|
||||
@endif
|
||||
</label>
|
||||
|
||||
<input type="file" id="catalogo" hidden wire:model="catalogo">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span class="lg:col-span-2 mb-2">
|
||||
|
||||
<button wire:click="updateCatalogo" class="inline-flex justify-center rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-[#B221FD] hover:bg-[#7a02b8] focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Actualizar</button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="lg:col-span-1 mb-8 text-center">
|
||||
|
||||
<button wire:click="eliminarCache" class=" mx-auto inline-flex justify-center rounded-md border border-transparent px-4 py-2 sm:mb-[0] mb-2 text-white bg-red-500 hover:bg-red-700 focus:shadow-outline-green ease-in-out sm-text-sm sm-leading-5">Eliminar
|
||||
cache</button>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@include('layouts.footer')
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user