@extends('layouts.auth') @section('title') {{ __('words.Add Brand') }} @endsection @push('page_style') @endpush @section('content')
@php $brandClass = $brand == \App\Models\AddNewBrand::FOR_BRAND ? 'brand' : ($brand == \App\Models\AddNewBrand::FOR_TIRE_BRAND ? 'tireBrand' : 'partBrand'); $brandNameText = !empty($brand) && $brand == \App\Models\AddNewBrand::FOR_BRAND ? ' Brand ' : (!empty($brand) && $brand == \App\Models\AddNewBrand::FOR_TIRE_BRAND ? ' Tire Brand ' : ' Part Brand '); @endphp
@csrf

{{ __('words.Add' . $brandNameText . 'Name') }}

{{-- {{dd(session('brand_name'))}} --}}
0 / 60
0 / 500
@php $world = App\Models\Country::select('id', 'name', 'iso2') ->orderBy('name', 'asc') ->get(); @endphp
@if ($errors->has('country_id')) {{ $errors->first('country_id') }} @endif
@if ($errors->has('file')) {{ $errors->first('file') }} @endif
{{ __('words.view.jpg') }}
4.99 MB

@if (!empty($brand) && $brand == \App\Models\AddNewBrand::FOR_BRAND)
@php $AllGeneralCategories = []; $genCat = []; @endphp @foreach (collect(getcategoryList())->slice(4) as $category) @if ($category->slug != 'services' && $category->slug != 'jobs') @php $cat = \App\Models\Category::where( 'parent_id', $category->id + 1, ) ->where('has_brand', 1) ->get(); if($cat->isNotEmpty()){ $subCats = []; foreach ($cat as $catItem) { // if($catItem->id == 464) { // dd("here",$catItem); // } $findSubGeneralCategory = \App\Models\Category::where( 'parent_id', $catItem->id, ) ->where('has_brand', 1) ->get(); if ($findSubGeneralCategory->isNotEmpty()) { $subSubCats = []; foreach ($findSubGeneralCategory as $subCatItem) { $findSubSubGeneralCategory = \App\Models\Category::where( 'parent_id', $subCatItem->id, )->where('has_brand', 1)->get(); if ($findSubSubGeneralCategory->isNotEmpty()) { $subSubSubCats = []; foreach ($findSubSubGeneralCategory as $subSubCatItem) { $findSubSubSubGeneralCategory = \App\Models\Category::where( 'parent_id', $subSubCatItem->id, )->where('has_brand', 1)->get(); if ($findSubSubSubGeneralCategory->isEmpty()) { $data = []; $data["id"] = $subSubCatItem->id; $data["title"] = $subSubCatItem->title; $data["slug"] = $subSubCatItem->slug; $subSubSubCats[] = $data; } } $AllGeneralCategories[] = [ 'general_category' => $category->title .' >> ' .$catItem->title .' >> ' .$subCatItem->title, 'sub_cat' => $subSubSubCats ]; }else{ $data = []; $data["id"] = $subCatItem->id; $data["title"] = $subCatItem->title; $data["slug"] = $subCatItem->slug; $subSubCats[] = $data; } } $AllGeneralCategories[] = [ 'general_category' => $category->title .' >> ' .$catItem->title, 'sub_cat' => $subSubCats ]; }else{ $data = []; $data["id"] = $catItem->id; $data["title"] = $catItem->title; $data["slug"] = $catItem->slug; $subCats[] = $data; } } $AllGeneralCategories[] = [ 'general_category' => $category->title, 'sub_cat' => $subCats ]; }else{ $data = []; $data["id"] = $category->id; $data["title"] = $category->title; $data["slug"] = $category->slug; $genCat[] = $data; } @endphp @endif @endforeach @php $AllGeneralCategories[] = [ 'general_category' => "General", 'sub_cat' => $genCat ]; @endphp @php $AllGeneralCategories = collect($AllGeneralCategories) ->sortBy('general_category', SORT_NATURAL | SORT_FLAG_CASE) ->values() ->all(); @endphp
@php $groupIndex = 0; @endphp @foreach ($AllGeneralCategories as $generalCategory) @php $groupAttr = 'group-' . $groupIndex++; @endphp
@foreach ($generalCategory["sub_cat"] as $sub_cat)
@endforeach
@endforeach
{{--
--}}
{{-- select Cateories to add brand --}}
@elseif(!empty($brand) && $brand == \App\Models\AddNewBrand::FOR_TIRE_BRAND)
@php $tireRimsCategory = App\Models\Category::where('slug', 'tires_rims')->first(); @endphp
@foreach ($tireRimsCategory->getAllSubCategory($tireRimsCategory->id) as $category) @if ($category->title != 'Other' && $category->slug != 'wheels')
@endif @endforeach
@elseif(!empty($brand) && $brand == \App\Models\AddNewBrand::FOR_PART_BRAND)
@php $partBrandCategory = App\Models\Category::where( 'slug', 'vehicles_parts_supplies', )->first(); @endphp
@foreach ($partBrandCategory->getAllSubCategory($partBrandCategory->id) as $category) @if ($category->title != 'Other' && $category->slug != 'consumables_accessories')
@php if ( !empty( \App\Models\Category::getAllSubCategory( $category->id, ) ) ) { $cat = \App\Models\Category::where( 'parent_id', $category->id, ) ->where('has_brand', 1) ->get(); } @endphp
@endif @endforeach
@endif

{{ __('attribute.Upload Photos') }}
{{ __( "words.I can't find this product on any site. And I will upload pictures of the product showing the brand name.", ) }}

{{ __('words.(Max. 2 images)') }}


{{ __('words.Please review the fields marked in red and correct the information.') }}

{{-- start Request modal after adding brand --}} {{-- end Request modal after adding brand --}} {{-- cropper modal start --}} @include('advertisment.partials.brandModal') {{-- cropper modal end --}}
@push('page_script') @endpush @endsection