تفاصيل العمل
{{ $item->views_count ?? 0 }}
{{ $item->favoritesCount() }}
@php $workType = $item->work_type ?? 'image'; @endphp
{{-- ── Cover image (always shown for all types) ── --}}
@if($item->logo && !str_contains($item->logo, 'default-image.png'))
@if($workType === 'image')
@else
@endif
@endif
{{-- ══════════════════════════════════════════ --}}
{{-- ── YouTube embed ── --}}
{{-- ══════════════════════════════════════════ --}}
@if($workType === 'youtube' && $item->link)
@php
preg_match(
'/(?:youtube\.com\/(?:watch\?(?:.*&)?v=|embed\/|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})/',
$item->link,
$ytMatches
);
$videoId = $ytMatches[1] ?? null;
@endphp
@if($videoId)
VIDEO
@else
{{-- Fallback if video ID can't be parsed --}}
مشاهدة الفيديو على YouTube
@endif
{{-- ══════════════════════════════════════════ --}}
{{-- ── Audio player ── --}}
{{-- ══════════════════════════════════════════ --}}
@elseif($workType === 'audio')
@php
$audioMedia = $item->getMedia('audios')->last();
$audioUrl = null;
if ($audioMedia) {
$audioPath = storage_path('app/public/' . $audioMedia->id . '/' . $audioMedia->file_name);
$audioUrl = file_exists($audioPath)
? asset('storage/' . $audioMedia->id . '/' . $audioMedia->file_name)
: $audioMedia->getUrl();
}
@endphp
@if($audioUrl)
@endif
{{-- ══════════════════════════════════════════ --}}
{{-- ── PDF viewer ── --}}
{{-- ══════════════════════════════════════════ --}}
@elseif($workType === 'pdf')
@php
$pdfMedia = $item->getMedia('pdfs')->last();
$pdfUrl = null;
if ($pdfMedia) {
$pdfPath = storage_path('app/public/' . $pdfMedia->id . '/' . $pdfMedia->file_name);
$pdfUrl = file_exists($pdfPath)
? asset('storage/' . $pdfMedia->id . '/' . $pdfMedia->file_name)
: $pdfMedia->getUrl();
}
@endphp
@if($pdfUrl)
@endif
{{-- ══════════════════════════════════════════ --}}
{{-- ── Image gallery (default) ── --}}
{{-- ══════════════════════════════════════════ --}}
@else
@foreach($item->getMedia('images') as $media)
@php
$imgPath = storage_path('app/public/' . $media->id . '/' . $media->file_name);
$imgUrl = file_exists($imgPath)
? asset('storage/' . $media->id . '/' . $media->file_name)
: $media->getUrl();
@endphp
@endforeach
@endif
{{-- end .work-desc --}}
{{-- Hidden fancybox entries for other portfolio works (image type only) --}}
@if(isset($allPortfolioWorks) && $allPortfolioWorks->isNotEmpty())
@foreach($allPortfolioWorks as $otherWork)
@if(($otherWork->work_type ?? 'image') === 'image')
@if($otherWork->logo && !str_contains($otherWork->logo, 'default-image.png'))
@endif
@foreach($otherWork->getMedia('images') as $media)
@php
$imgPath = storage_path('app/public/' . $media->id . '/' . $media->file_name);
$imgUrl = file_exists($imgPath)
? asset('storage/' . $media->id . '/' . $media->file_name)
: $media->getUrl();
@endphp
@endforeach
@endif
@endforeach
@endif
وصف العمل
{!! format_text($item->description) !!}
تواريخ العمل
تاريخ النشر:
{{\Carbon\Carbon::parse($item->created_at)->locale(app()->getLocale())->translatedFormat('d F Y')}}
@if($item->finish_date)
تاريخ الإنجاز:
{{\Carbon\Carbon::parse($item->finish_date)->locale(app()->getLocale())->translatedFormat('d F Y')}}
@endif
@if($item->skills->isNotEmpty())
@lang('Skills') المستخدمة في العمل
@endif
@php $isLiked = auth()->check() && $item->isFavoritedBy(auth()->id()); @endphp
إعجاب
{{ $item->favoritesCount() }}
مشاركة
@if(count($commonItems) > 0)
أعمال آخرى لـ {{ $user->first_name }} {{ $user->last_name }}
@foreach($commonItems as $item)
@include('front.user.gallery._work_card')
@endforeach
@endif