@forelse($projects as $project)
@php
$showUrl = route('projects.show', $project->slug);
$brochureRaw = trim((string) ($project->brochure_path ?? ''));
if ($brochureRaw === '') {
$brochureUrl = '';
} elseif (str_starts_with($brochureRaw, 'http://') || str_starts_with($brochureRaw, 'https://')) {
$brochureUrl = $brochureRaw;
} elseif (str_starts_with($brochureRaw, 'projects/')) {
$brochureUrl = asset('storage/'.$brochureRaw);
} else {
$brochureUrl = asset($brochureRaw);
}
$videoRaw = trim((string) ($project->video_url ?? ''));
if ($videoRaw === '') {
$videoUrl = '';
} elseif (str_starts_with($videoRaw, 'http://') || str_starts_with($videoRaw, 'https://')) {
$videoUrl = $videoRaw;
} else {
$videoUrl = 'https://www.youtube.com/watch?v='.$videoRaw;
}
@endphp
@if($project->logo)
@endif
{!! nl2br(e($project->location ?? '')) !!}
@if($project->unit_type)
{{ $project->unit_type }}
@endif
@if($project->floors)
{{ $project->floors }}
@endif
@if($project->status_label_1)
@if($project->status_icon_1)
 ?: asset('img/under-construction.png') }})
@endif
{{ $project->status_label_1 }}
@endif
@if($project->status_label_2)
@if($project->status_icon_2)
 ?: asset('img/nonrera.png') }})
@endif
{{ $project->status_label_2 }}
@endif
@if($videoUrl)
@endif
@if($brochureUrl)
@endif
@empty
No ongoing projects at the moment. Please check back soon.
@endforelse