@extends('layouts.app') @section('title', 'Call History') @section('content')

Call History

Manage your video and audio calls

Current Balance

{{ auth()->user()->credits }} Credits

@if($ongoingCall)

Ongoing Call

{{ $ongoingCall->call_type === 'video' ? 'Video' : 'Audio' }} call with {{ $ongoingCall->caller_id === auth()->id() ? $ongoingCall->receiver->name : $ongoingCall->caller->name }}

Join Call
@endif

Total Calls

{{ $statistics['total_calls'] }}

Completed

{{ $statistics['completed_calls'] }}

Total Duration

{{ $statistics['total_duration_formatted'] }}

Credits Spent

{{ $statistics['total_credits_spent'] }}

Recent Calls

@if($callHistory->count() > 0)
@foreach($callHistory as $call)
@php $otherUser = $call->caller_id === auth()->id() ? $call->receiver : $call->caller; @endphp {{ $otherUser->name }}

{{ $otherUser->name }}

@if($call->call_type === 'video') @else @endif {{ ucfirst($call->call_status) }}

{{ $call->caller_id === auth()->id() ? 'Outgoing' : 'Incoming' }}

@if($call->duration_seconds)

{{ $call->formatted_duration }}

@endif @if($call->credits_used)

{{ $call->credits_used }} credits

@endif

{{ $call->created_at->format('M j, g:i A') }}

@if($call->call_status === 'completed' && !$call->quality_rating) @endif @if($call->call_status === 'ongoing') Join @endif
@endforeach
{{ $callHistory->links() }}
@else

No calls yet. Start connecting with your matches!

View Matches
@endif
@endsection @push('scripts') @endpush