@extends('layouts.app') @section('title', 'Alerts Management') @section('content')

Alerts Management

@forelse($alerts as $alert) @empty @endforelse
Type Sensor Message Status Date Actions
@if($alert->type === 'leak') Gas Leak @elseif($alert->type === 'low') Low Gas @else {{ ucfirst($alert->type) }} @endif
{{ $alert->sensor->device_uuid ?? 'N/A' }}
{{ $alert->sensor->gasCompany->name ?? 'No Company' }}
{{ $alert->message }}
@if($alert->data)
@foreach($alert->data as $key => $value) {{ ucfirst($key) }}: {{ $value }}@if(!$loop->last), @endif @endforeach
@endif
@if($alert->resolved_at) Resolved
{{ $alert->resolved_at->diffForHumans() }}
@else Active @endif
{{ $alert->created_at->format('M j, Y') }}
{{ $alert->created_at->format('g:i A') }}
View @if(!$alert->resolved_at)
@csrf @method('PATCH')
@endif
No alerts found.
@if($alerts->hasPages())
{{ $alerts->links() }}
@endif
@push('scripts') @endpush @endsection