 @php
     $language = App\Models\Language::all();
     $selectLang = $language->where('code', config('app.locale'))->first();
     $currentLang = session('lang') ? $language->where('code', session('lang'))->first() : $language->where('is_default', Status::YES)->first();
 @endphp

<div class="dropdown lang-box">
    <button class="lang-box-btn" data-bs-toggle="dropdown">
        <span class="thumb">
            <img class="fit-image" src="{{ getImage(getFilePath('language') . '/' . $currentLang->image, getFileSize('language')) }}" alt="bd">
        </span>
        <span class="text">{{ __($currentLang->name) }}</span>
        <span class="icon">
            <i class="fas fa-angle-down"></i>
        </span>
    </button>

    <ul class="dropdown-menu">
        @foreach ($language as $item)
            <li class="lang-box-item" data-code="{{ $item->code }}">
                <a href="{{ route('lang', $item->code) }}" class="lang-box-link">
                    <div class="thumb">
                        <img src="{{ getImage(getFilePath('language') . '/' . $item->image, getFileSize('language')) }}" alt="usa">
                    </div>
                    <span class="text">{{ __($item->name) }}</span>
                </a>
            </li>
        @endforeach
    </ul>
</div>
