@php $array = \cache()->remember('background', 300, function () { $bg = new \App\Models\SiteBackground(); return $bg->getImages(); }); @endphp
@if ($array->isNotEmpty()) @php $imageId = $array->random(); @endphp @else @endif