@extends(auth()->user()->hasRole('Company') ? 'wallet.layouts.master' : 'dashboard.layouts.master') @php $folderTitle = $currentFolder === 'INBOX' ? 'Inbox' : ($folders ? (collect($folders)->firstWhere('full_name', $currentFolder)['name'] ?? $currentFolder) : $currentFolder); $inboxUnread = collect($folders)->firstWhere('full_name', 'INBOX')['unread'] ?? 0; @endphp @section('title', $folderTitle . ($inboxUnread && $currentFolder === 'INBOX' ? ' (' . $inboxUnread . ')' : '') . ' | Email') @section('page-css') @endsection @section('main-content')

Email

Compose
@foreach($folders as $f) @php $encoded = str_replace('/', '---', $f['full_name']); $isActive = $currentFolder === $f['full_name']; $label = strtolower($f['name']) === 'inbox' ? 'Inbox' : $f['name']; @endphp {{ $label }} @if(!empty($f['unread'])) {{ $f['unread'] }} @elseif(!empty($f['count'])) {{ $f['count'] }} @endif @endforeach
@csrf
@forelse($emails as $email) @php $showUrl = route('email.show', ['folder' => $encodedFolder, 'uid' => $email['uid']]); @endphp @empty @endforelse
{{ $email['initial'] }}
{{ $email['from_name'] ?: $email['from_email'] }}
{{ $email['attachments'] }}

@if($email['date']) {{ $email['date']->format('M j, g:i A') }} @endif

@if($total) Showing {{ ($page - 1) * $perPage + 1 }}–{{ min($page * $perPage, $total) }} of {{ $total }} {{ Str::plural('email', $total) }} @else 0 emails @endif @if($search) · Clear search @endif @if($totalPages > 1)
  • @for($p = max(1, $page - 2); $p <= min($totalPages, $page + 2); $p++)
  • {{ $p }}
  • @endfor
@endif
@include('wallet.pages.email.partials.compose-modal', ['composeFrom' => $composeFrom ?? null]) @endsection @section('page-js') @endsection