@php $today = \Carbon\Carbon::now()->format('Y-m-d'); $ads = \App\Models\Ads::where('type', $listing->type) ->where('status', 1) ->whereDate('start_date', '<=', $today) ->whereDate('end_date', '>=', $today) ->inRandomOrder() ->take(2) ->get(); @endphp @if($ads->count() > 0)

{{ get_phrase('Sponsored Post') }}

@foreach ($ads as $ad)
@if($ad->image && file_exists(public_path($ad->image))) {{ $ad->title }} @else placeholder @endif
{{ $ad->title }}

{{ \Illuminate\Support\Str::limit(trim(strip_tags($ad->description)), 100) }}

@endforeach
@endif