@extends('layouts.app') @section('title', 'Visiting') @section('title-flex')
@if (\Auth::user()->isModeratorOrAbove()) Add new endorsement @endif
@endsection @section('header') @vite(['resources/sass/bootstrap-table.scss', 'resources/js/bootstrap-table.js']) @endsection @section('content')
Visiting Endorsements
@foreach($areas as $a) @endforeach @foreach($endorsements as $visitingEndorsement) @foreach($areas as $a) @php $count = 0; @endphp @foreach($visitingEndorsement->areas as $endorsedArea) @if($endorsedArea->id == $a->id) @php $count++; @endphp @endif @endforeach @if(!$count) @endif @endforeach @endforeach
Member Rating{{ $a->name }}
@can('view', $visitingEndorsement->user) {{ $visitingEndorsement->user->name }} ({{ $visitingEndorsement->user->id }}) @else {{ $visitingEndorsement->user->name }} ({{ $visitingEndorsement->user->id }}) @endcan {{ $visitingEndorsement->ratings->whereNotNull('vatsim_rating')->first()->name }} Approved {{-- Display the MASC endorsements connected to this area --}} @foreach($endorsedArea->ratings->whereNull('vatsim_rating') as $areaRating) @foreach($visitingEndorsement->user->endorsements->where('type', 'MASC')->where('revoked', false)->where('expired', false) as $mascEndorsement) @if($areaRating->id == $mascEndorsement->ratings->first()->id) {{ $areaRating->name }} @endif @endforeach @endforeach
@endsection