@php $popupsList = collect([]); try { if (\Illuminate\Support\Facades\Schema::hasTable('popups')) { $popupsList = \App\Models\Popup::where('status', 1)->orderBy('serial_number', 'ASC')->get(); } } catch (\Throwable $e) { $popupsList = collect([]); } @endphp @if (count($popupsList) > 0) @foreach ($popupsList as $popup) @if ($popup->type == 1 && !empty($popup->image)) {{-- Type 1: Image Only --}} @endif @endforeach @endif