log historial
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Log_historial;
|
||||
use Livewire\Component;
|
||||
|
||||
class ShowLogGeneral extends Component
|
||||
{
|
||||
public $entradas;
|
||||
|
||||
public $buscar;
|
||||
public $filtro_fecha;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$query = Log_historial::query();
|
||||
|
||||
if ($this->buscar) {
|
||||
$query->where('detalle', 'like', '%' . $this->buscar . '%');
|
||||
}
|
||||
|
||||
if ($this->filtro_fecha) {
|
||||
$query->whereDate('created_at', $this->filtro_fecha);
|
||||
}
|
||||
|
||||
$logs = $query->orderBy('id', 'desc')->paginate($this->entradas);
|
||||
|
||||
return view('livewire.show-log-historial', [
|
||||
'logs' => $logs
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user