@php // $section is available from the page renderer // Default values for section content $sectionTitle = $section->content['title'] ?? 'Our Recent Work'; $numberOfProjects = (int)($section->content['number_of_items'] ?? 3); $viewAllLink = $section->content['view_all_link'] ?? null; // e.g., '/portfolio' $viewAllText = $section->content['view_all_text'] ?? 'View Full Portfolio'; // Fetch projects from DigitalVocano module try { $portfolioProjects = \Modules\DigitalVocano\Entities\Project::query() ->where('is_published', true) ->orderBy('sort_order', 'asc') ->orderBy('created_at', 'desc') ->take($numberOfProjects) ->get(); } catch (\Throwable $e) { $portfolioProjects = collect(); \Illuminate\Support\Facades\Log::error("Error fetching DigitalVocano projects for landing page section: " . $e->getMessage()); } @endphp @if($portfolioProjects->isNotEmpty())

{{ $sectionTitle }}

@foreach($portfolioProjects as $dvProject)
@if($dvProject->featured_image_url) {{-- Link to detail page --}} {{ $dvProject->name }} @else
No Image
@endif

{{ $dvProject->name }}

{{ Str::limit($dvProject->short_description ?? 'Amazing project.', 100) }}

View Project → @if($dvProject->demo_url) Live Demo → @endif
@endforeach
@if($viewAllLink) @endif
@endif