@if (! isset($single) && $messages->count() == 10)
— {{ __('general.load_messages') }}
@endif @foreach ($messages as $msg) @php $mediaCount = $msg->media->count(); $allFiles = $msg->media()->groupBy('type')->get(); $getFirstFile =$msg->media()->whereIn('type', ['image', 'video'])->first(); $countFilesImage = $msg->media->where('type', 'image')->count(); $countFilesVideo = $msg->media->where('type', 'video')->count(); $countFilesAudio = $msg->media->where('type', 'music')->count(); $mediaImageVideoTotal = $msg->media->whereIn('type', ['image', 'video'])->count(); $chatMessage = $msg->message ? Helper::linkText(Helper::checkText($msg->message)) : null; $classInvisible = ! request()->ajax() ? 'invisible' : null; $nth = 0; // nth foreach nth-child(3n-1) $mediaImageVideo = $msg->media() ->whereIn('type', ['image', 'video']) ->get(); if ($getFirstFile && $getFirstFile->type == 'image') { $urlMedia = url('media/storage/focus/message', $getFirstFile->id); $backgroundPostLocked = 'background: url('.$urlMedia.') no-repeat center center #b9b9b9; background-size: cover;'; $textWhite = 'text-white'; } elseif ($getFirstFile && $getFirstFile->type == 'video' && $getFirstFile->video_poster) { $videoPoster = url('media/storage/focus/message', $getFirstFile->id); $backgroundPostLocked = 'background: url('.$videoPoster.') no-repeat center center #b9b9b9; background-size: cover;'; $textWhite = 'text-white'; } else { $backgroundPostLocked = null; $textWhite = null; } @endphp @if ($msg->sender->id == auth()->user()->id)
@if ($msg->tip == 'no' && !$msg->gift_id) @endif
@include('includes.media-messages')
@if ($mediaCount != 0 && $msg->message != '')
{!! $chatMessage !!}
@endif @if ($msg->price != 0.00) {{ Helper::formatPrice($msg->price) }} - @endif
@else
@if ($msg->price != 0.00 && ! auth()->user()->checkPayPerViewMsg($msg->id))
{{ __('general.unlock_for') }} {{Helper::formatPrice($msg->price)}}
    @if ($mediaCount == 0)
  • {{ __('admin.text') }}
  • @endif @foreach ($allFiles as $media) @if ($media->type == 'image')
  • {{$countFilesImage}}
  • @endif @if ($media->type == 'video')
  • {{$countFilesVideo}} @if ($media->duration_video && $countFilesVideo == 1 || $media->quality_video && $countFilesVideo == 1) @if ($media->quality_video){{ $media->quality_video }}@endif {{ $media->duration_video }} @endif
  • @endif @if ($media->type == 'music')
  • {{$countFilesAudio}}
  • @endif @if ($media->type == 'zip')
  • {{$media->file_size}}
  • @endif @if ($media->type == 'epub')
  • {{$media->file_size}}
  • @endif @endforeach
@endif @if ($msg->price == 0.00 || $msg->price != 0.00 && auth()->user()->checkPayPerViewMsg($msg->id))
@include('includes.media-messages')
@endif @if ($mediaCount != 0 && $msg->message != '')
{!! $chatMessage !!}
@endif @if ($msg->price != 0.00) - {{ Helper::formatPrice($msg->price) }} {{ auth()->user()->checkPayPerViewMsg($msg->id) ? __('general.paid') : null }} @endif
@endif @endforeach