@php
$banners = \App\Models\Banner::withoutTrashed()
->where('banner_put_on_at', '<=', date('Y-m-d H:i:s'))
->where(function ($query) {
$query->where('banner_take_off_at', '>=', date('Y-m-d H:i:s'))
->orWhereNull('banner_take_off_at');
})
->orderByRaw('banner_sort_order DESC, banner_put_on_at DESC')
->get();
@endphp
@foreach($banners as $banner)
@endforeach