@props([ 'username' => null, ]) @php /* | Configurable Instagram feed. Renders a responsive grid of curated posts | with a hover overlay and caption, or the raw embed fallback, and nothing | at all when the feed is disabled or empty (progressive enhancement). */ $feed = app(\App\Services\InstagramFeedService::class); $enabled = $feed->enabled(); $posts = $enabled ? $feed->posts() : []; $embed = $enabled ? $feed->embed() : null; $hasPosts = $posts !== []; $handle = $username ?: $feed->username(); $profileUrl = $feed->profileUrl(); @endphp @if ($enabled && ($hasPosts || filled($embed)))
{{ '@'.$handle }}
@if ($hasPosts)
@foreach ($posts as $post) @if ($post['caption']) {{ $post['caption'] }} @endif @endforeach
@elseif (filled($embed))
{!! $embed !!}
@endif
@endif