@extends('admin::layouts.content') @section('page_title') {{ __('velocity::app.admin.meta-data.title') }} @stop @php $locale = core()->checkRequestedLocaleCodeInRequestedChannel(); $channel = core()->getRequestedChannelCode(); $channelLocales = core()->getAllLocalesByRequestedChannel()['locales']; $metaRoute = $metaData ? route('velocity.admin.store.meta-data', ['id' => $metaData->id]) : route('velocity.admin.store.meta-data', ['id' => 'new']); @endphp @push('css') @endpush @section('content')
@csrf
@php $images = [ 4 => [], 3 => [], 2 => [], ]; $index = 0; foreach ($metaData->get('locale')->all() as $key => $value) { if ($value->locale == $locale) { $index = $key; } } $advertisement = json_decode($metaData->get('advertisement')->all()[$index]->advertisement, true); @endphp @if(! isset($advertisement[4]) || ! count($advertisement[4])) @php $images[4][] = [ 'id' => 'image_1', 'url' => asset('/themes/velocity/assets/images/big-sale-banner.webp'), ]; $images[4][] = [ 'id' => 'image_2', 'url' => asset('/themes/velocity/assets/images/seasons.webp'), ]; $images[4][] = [ 'id' => 'image_3', 'url' => asset('/themes/velocity/assets/images/deals.webp'), ]; $images[4][] = [ 'id' => 'image_4', 'url' => asset('/themes/velocity/assets/images/kids.webp'), ]; @endphp @else @foreach ($advertisement[4] as $index => $image) @php $images[4][] = [ 'id' => 'image_' . $index, 'url' => Storage::url($image), ]; @endphp @endforeach @endif {{ __('velocity::app.admin.meta-data.image-four-resolution') }}
@if(! isset($advertisement[3]) || ! count($advertisement[3])) @php $images[3][] = [ 'id' => 'image_1', 'url' => asset('/themes/velocity/assets/images/headphones.webp'), ]; $images[3][] = [ 'id' => 'image_2', 'url' => asset('/themes/velocity/assets/images/watch.webp'), ]; $images[3][] = [ 'id' => 'image_3', 'url' => asset('/themes/velocity/assets/images/kids-2.webp'), ]; @endphp @else @foreach ($advertisement[3] as $index => $image) @php $images[3][] = [ 'id' => 'image_' . $index, 'url' => Storage::url($image), ]; @endphp @endforeach @endif {{ __('velocity::app.admin.meta-data.image-three-resolution') }}
@if(! isset($advertisement[2]) || ! count($advertisement[2])) @php $images[2][] = [ 'id' => 'image_1', 'url' => asset('/themes/velocity/assets/images/toster.webp'), ]; $images[2][] = [ 'id' => 'image_2', 'url' => asset('/themes/velocity/assets/images/trimmer.webp'), ]; @endphp @else @foreach ($advertisement[2] as $index => $image) @php $images[2][] = [ 'id' => 'image_' . $index, 'url' => Storage::url($image), ]; @endphp @endforeach @endif {{ __('velocity::app.admin.meta-data.image-two-resolution') }}
@stop @push('scripts') @endpush