@php
    $tools = App\Models\Tool::active()
        ->whereHas('category', function ($q) {
            $q->active();
        })
        ->orderby('views', 'DESC')
        ->limit(6)
        ->get();
@endphp
<div class="col-lg-4 col-xl-3">
    <aside class="sidebar">
        @if (gs('custom_ads'))
            <div class="sidebar-block">
                <div class="ad-banner ad-banner--page sidebar-thumb">
                    <x-ads size="300x600" />
                </div>
            </div>
        @endif

        @if ($tools->isNotEmpty())
            <div class="sidebar-block">
                <div class="sidebar-block__header">
                    <h5 class="sidebar-block__title">@lang('Popular Tools')</h5>
                </div>
                <div class="sidebar-block__body">
                    <ul class="tools-list">
                        @foreach ($tools as $tool)
                            <li class="tools-list__item">
                                <a href="{{ route($tool->route) }}" class="tools-list__link">
                                    <i class="fas fa-check"></i>
                                    <span>{{ __($tool->name) }}</span>
                                </a>
                            </li>
                        @endforeach
                    </ul>
                </div>
            </div>
        @endif
    </aside>
</div>
