filtros por detalle y fecha
This commit is contained in:
@@ -8,10 +8,23 @@ use Livewire\Component;
|
||||
class ShowLogGeneral extends Component
|
||||
{
|
||||
public $entradas;
|
||||
|
||||
public $buscar;
|
||||
public $filtro_fecha;
|
||||
|
||||
public function render()
|
||||
{
|
||||
$logs = Log_general::orderby('id', 'desc')->paginate($this->entradas);
|
||||
$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
|
||||
|
||||
Reference in New Issue
Block a user