{{-- resources/views/themes/general/sections/featured-projects.blade.php --}}
@php
$sectionTitle = $section->title ?? 'Featured Projects';
$projectIdentifiers = $section->content['projects'] ?? []; // Expects an array of slugs or IDs
$projects = collect(); // Initialize an empty collection
if (!empty($projectIdentifiers)) {
// Assuming projects are also LpPage entries for now.
// Replace with your actual Project model if you have one.
$projects = \Modules\LandingPage\Entities\LpPage::whereIn('slug', $projectIdentifiers)
->where('is_published', true)
// Add any other conditions, e.g., ->where('page_type', 'project')
->orderBy('sort_order')
->take($section->content['limit'] ?? 3) // Allow setting a limit via section content
->get();
}
@endphp