37 lines
729 B
PHP
Executable File
37 lines
729 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use App\Models\Log_general;
|
|
use Livewire\Component;
|
|
use Livewire\WithPagination;
|
|
|
|
class ShowLogGeneral extends Component
|
|
{
|
|
use WithPagination;
|
|
public $entradas;
|
|
|
|
public $buscar;
|
|
public $filtro_fecha;
|
|
|
|
public function render()
|
|
{
|
|
$query = Log_general::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-general', [
|
|
'logs' => $logs
|
|
]);
|
|
}
|
|
}
|
|
|