mantenimiento

This commit is contained in:
Felipe
2024-04-29 18:21:04 -05:00
parent 5890584bb8
commit 80c8748182
6 changed files with 137 additions and 2 deletions
+3 -1
View File
@@ -93,7 +93,9 @@ class MenuController extends Controller
return view('menu/roles');
}
public function mantenimiento(){
return view('menu/mantenimiento');
}
public function pay($estado){
return view('menu/order',[
+55
View File
@@ -0,0 +1,55 @@
<?php
namespace App\Http\Livewire;
use App\Models\Historial_cuenta;
use Livewire\Component;
use Jantinnerezo\LivewireAlert\LivewireAlert;
use Livewire\WithPagination;
class ShowMantenimiento extends Component
{
use WithPagination;
use LivewireAlert;
public $entradas = 10;
public $delete_1 = [];
public $cont = [];
public function render()
{
$historialesConEstadoPendiente = Historial_cuenta::whereHas('historial', function ($query) {
$query->where('estado', 'pendiente');
})->paginate($this->entradas);
$this->cont = $historialesConEstadoPendiente->toArray();
return view('livewire.show-mantenimiento',[
'historiales' => $historialesConEstadoPendiente
]);
}
public function seleccionarTodos(){
if (count($this->delete_1) == 0) {
$this->delete_1 = array_column($this->cont['data'], 'id');
} else {
$this->delete_1 = [];
}
dd($this->delete_1);
}
public function eliminarCuentas()
{
Historial_cuenta::whereIn('id', $this->delete_1)->delete();
$this->delete_1 = [];
$this->alert('success', 'Historiales eliminados correctamente!', [
'position' => 'top'
]);
}
}
-1
View File
@@ -770,6 +770,5 @@ class ShowPlanes extends Component
}
//dd($this->delete_1);
}
}