@php use App\Models\Store; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Str; use App\Services\TranslationService; use App\Services\StoreService; use App\Services\MediaService; $language_code = app(TranslationService::class)->getLanguageCode(); $user = Auth::user(); $isPublicDisk = $user->disk == 'public' ? 1 : 0; $user_image = $isPublicDisk ? (!empty($user->image) && file_exists(public_path(config('constants.USER_IMG_PATH') . $user->image)) ? app(MediaService::class)->getMediaImageUrl($user->image, 'USER_IMG_PATH') : app(MediaService::class)->getImageUrl('no-user-img.jpeg', '', '', 'image', 'NO_USER_IMAGE')) : $user->image; $store_details = fetchDetails(Store::class, ['status' => 1], '*'); $default_store_id = ''; $stores = Store::where('is_default_store', 1)->where('status', 1)->get(); if ($stores->isNotEmpty()) { $default_store_id = $stores[0]->id; $default_store_name = app(TranslationService::class)->getDynamicTranslation(Store::class, 'name', $stores[0]->id, $language_code); $isPublicDisk = $stores[0]->disk == 'public' ? 1 : 0; $default_store_image = $isPublicDisk ? asset(config('constants.STORE_IMG_PATH') . $stores[0]->image) : $stores[0]->image; } else { $default_store_id = ''; $default_store_name = ''; $default_store_image = ''; } if (session('store_id') !== null && !empty(session('store_id'))) { $store_id = session('store_id'); } else { $store_id = $default_store_id; session(['store_id' => $default_store_id]); session(['store_name' => $default_store_name]); session(['store_image' => $default_store_image]); } $store_name = session('store_name') !== null && !empty(session('store_name')) ? session('store_name') : ''; // dd($store_name); if (!empty($stores) && isset($stores[0])) { $isPublicDisk = $stores[0]->disk == 'public' ? 1 : 0; } else { $isPublicDisk = 0; } $image = $isPublicDisk ? asset(config('constants.STORE_IMG_PATH') . session('store_image')) : session('store_image'); $store_image = session('store_image') !== null && !empty(session('store_image')) ? $image : ''; use App\Models\Language; $languages = Language::all(); @endphp @php $store_id = app(StoreService::class)->getStoreId(); $store_details = fetchDetails( Store::class, ['id' => $store_id], ['primary_color', 'secondary_color', 'hover_color', 'active_color'], ); $primary_colour = isset($store_details[0]->primary_color) && !empty($store_details[0]->primary_color) ? $store_details[0]->primary_color : '#B52046'; $secondary_color = isset($store_details[0]->secondary_color) && !empty($store_details[0]->secondary_color) ? $store_details[0]->secondary_color : '#201A1A'; $hover_color = isset($store_details[0]->hover_color) && !empty($store_details[0]->hover_color) ? $store_details[0]->hover_color : '#911A38'; $active_color = isset($store_details[0]->active_color) && !empty($store_details[0]->active_color) ? $store_details[0]->active_color : '#6D132A'; $background_opacity_color = $primary_colour . '10'; @endphp