@php
    $blogObj = new \app\models\Blog();
    $limit = $args['number_of_posts'] ?? 3;
    $blogs = $blogObj->recentBlogs(['limit'=>$limit]);
@endphp
<div class="p-30 bg-white dark:bg-card sm:mb-30 mb-20 pb-10 widget recent-posts-entry">
    <div class="widget-title mb-20 widget-title">
        <h4 class="text-[26px] font-semibold text-secondary dark:text-white title">{{ $args['title'] ?? __('Recent Post') }}</h4>
    </div>
    <div class="widget-post-bx">
        @forelse($blogs as $blog)
            <div class="widget-post clearfix flex items-center mb-20">
                <div class="dz-media xl:w-120 w-90 mr-15">
                    <img src="{{ DzHelper::getStorageImage('storage/blog-images/'.@$blog->feature_img->value) }}" alt="{{ __('Blog Image') }}" width="200" height="143">
                </div>
                <div class="dz-info flex-1">
                    <div class="dz-meta">
                        <ul>
                            @if (!empty($args['display_date']))
                            <li class="post-date dark:text-white/60"><a href="{{ DzHelper::laraBlogLink($blog->id) }}">{{ Carbon\Carbon::parse($blog->publish_on)->format(config('Site.custom_date_format')) }}</a></li>
                            @endif
                        </ul>
                    </div>
                    <h6 class="title xl:text-xl text-lg"><a href="{{ DzHelper::laraBlogLink($blog->id) }}">{{ Str::limit($blog->title, 40, ' ...') }}</a></h6>
                </div>
            </div>
        @empty
        @endforelse
    </div>
</div>
