@extends('layouts.app') @section('content') @php $currentSort = request('sort_column') ?: 'data'; $currentDirection = request('sort_direction', 'DESC'); // Se não há sort_column, usar data DESC como padrão if (!request()->has('sort_column')) { $currentSort = 'data'; $currentDirection = 'DESC'; } $sortUrl = function($column) use ($currentSort, $currentDirection) { $direction = ($currentSort == $column && $currentDirection == 'ASC') ? 'DESC' : 'ASC'; $params = array_merge(request()->query(), ['sort_column' => $column, 'sort_direction' => $direction, 'page' => 1]); return request()->url() . '?' . http_build_query($params); }; $sortIndicator = function($column) use ($currentSort, $currentDirection) { if ($currentSort == $column || ($column == 'data' && $currentSort == 'data')) { return $currentDirection == 'DESC' ? '▼' : '▲'; } return ''; }; @endphp

Log de Acessos

Últimas movimentações registradas pelo sistema.

Limpar
@csrf
@if($logs->count() > 0) @foreach($logs as $log) @endforeach @else @endif
Data @if($currentSort == 'data' || !request()->has('sort_column')) {{ $sortIndicator('data') }} @endif Movimento @if($currentSort == 'movimento') {{ $sortIndicator('movimento') }} @endif Chave @if($currentSort == 'chave') {{ $sortIndicator('chave') }} @endif Cliente @if($currentSort == 'cliente') {{ $sortIndicator('cliente') }} @endif Grupo @if($currentSort == 'grupo') {{ $sortIndicator('grupo') }} @endif IP @if($currentSort == 'ip') {{ $sortIndicator('ip') }} @endif MAC @if($currentSort == 'mac') {{ $sortIndicator('mac') }} @endif
{{ \Carbon\Carbon::parse($log->data)->format('d/m/Y H:i') }} {{ $log->movimento == 1 ? 'Entrada' : 'Saída' }} {{ $log->chave }} {{ $log->cliente_nome ?? '-' }} {{ $log->grupo ?? '-' }} {{ $log->ipconex ?? '-' }} {{ $log->mac_addr ?? '-' }}
Nenhum registro encontrado para os filtros informados.
{{ $logs->links('vendor.pagination.custom') }} @endsection