{{-- 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

{{ $sectionTitle }}

@if($projects->count() > 0)
@foreach ($projects as $project)
{{ $project->title }}

{{ $project->title }}

{{ $project->meta_description ?? \Illuminate\Support\Str::limit(strip_tags($project->content), 120) }}

View Project →
@endforeach
@else

No featured projects to display at the moment.

@endif
@pushOnce('styles') @endPushOnce @pushOnce('scripts') @endPushOnce