@php use App\Models\Publicidade; use Illuminate\Support\Str; $publicidades = Publicidade::where('is_active', 1) ->where(function($query){ $query->where('is_permanent', 1) ->orWhere(function($q){ $now = now()->toDateString(); $q->where(function($qq) use ($now) { $qq->where('start_date', '<=', $now) ->where('end_date', '>=', $now); })->orWhere(function($qq){ $qq->whereNull('start_date')->whereNull('end_date'); }); }); }) ->latest() ->get(); @endphp @if($publicidades->count()) {{-- HEADER --}} Campanhas & Promoções Descubra ofertas exclusivas e novidades selecionadas {{-- GRID --}} @foreach($publicidades as $pub) {{-- IMAGE --}} {{-- OVERLAY --}} {{-- CONTENT --}} {{ $pub->title }} {{ Str::limit($pub->content, 90) }} @endforeach @endif
Descubra ofertas exclusivas e novidades selecionadas
{{ Str::limit($pub->content, 90) }}