@extends('layouts.admin') @section('title', get_phrase('Listing List')) @section('admin_layout')

{{ ucwords($type).' '.get_phrase('Lists') }}

{{get_phrase('Add New Listing')}}
@if(count($listings)) @if ($type == 'car') @elseif($type == 'real-estate' || $type == 'hotel') @endif @php $num = 1 @endphp @foreach ($listings as $listing) @php $category = App\Models\Category::where('id', $listing->category)->first()->name; $image = json_decode($listing->image)[0]??0; if($type == 'car'){ $brand = App\Models\Amenities::where('id', $listing->brand)->first()->name ??'N/A'; $model = App\Models\Amenities::where('id', $listing->model)->first()->name ?? 'N/A';; } // Claimed if($listing->type == 'beauty'){ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', 'beauty')->first(); } elseif($listing->type == 'hotel'){ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', 'hotel')->first(); } elseif($listing->type == 'car'){ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', 'car')->first(); } elseif($listing->type == 'restaurant'){ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', 'restaurant')->first(); }elseif($listing->type == 'real-estate'){ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', 'real-estate')->first(); }else{ $claimStatus = App\Models\ClaimedListing::where('listing_id', $listing->id)->where('listing_type', $listing->type)->first(); } @endphp {{-- @if ($type == 'car') @elseif($type == 'beauty') @elseif($type == 'real-estate' || $type == 'hotel') @endif --}} @if ($type == 'car') @elseif($type == 'hotel') @elseif($type == 'real-estate') @endif @endforeach
{{get_phrase('ID')}} {{get_phrase('Image')}} {{get_phrase('Title')}} {{get_phrase('Category')}} {{get_phrase('Brand')}} {{get_phrase('Model')}} {{get_phrase('Price')}} {{get_phrase('Price')}} {{get_phrase('Visibility')}} {{get_phrase('Action')}}
{{$num++}} {{$listing->title ?? 'N/A'}} @if(isset($claimStatus) && $claimStatus->status == 1) @endif {{$category}} {{$brand}} {{$model}} {{currency($listing->price)}} {{currency($listing->price)}} {{ $brand }} {{ $model }} @if(!empty($listing->discount_price) && $listing->discount_price < $listing->price) {{ currency($listing->price) }} {{ currency($listing->discount_price) }} @else {{ currency($listing->price) }} @endif @if(!empty($listing->discount_price) && $listing->discount_price < $listing->price) {{ currency($listing->price) }} {{ currency($listing->discount_price) }} @else {{ currency($listing->price) }} @endif @if(!empty($listing->discount) && $listing->discount < $listing->price) {{ currency($listing->price) }} {{ currency($listing->discount) }} @else {{ currency($listing->price) }} @endif {{ucwords($listing->visibility)}}
@else @include('layouts.no_data_found') @endif
@endsection