@extends('site.layouts.master') @section('seoTags') @seoTags() @endsection @php $seo = SEO\Models\Page::where('path', URL::full())->first(); $lastSegment = request()->query('address'); if (strpos($lastSegment, 'ا') > 0 || strpos($lastSegment, 'ب') > 0 || strpos($lastSegment, 'س') > 0 || strpos($lastSegment, 'ج') > 0 || strpos($lastSegment, 'ي') > 0 || strpos($lastSegment, 'alayjar') > 0 || strpos($lastSegment, 'llbyaa') > 0) { app()->setLocale('ar'); } if (LaravelLocalization::getCurrentLocale() == 'ar') { $Ttype = 'وحدتك'; $Ttypea = 'وحدات'; } else { $Ttype = 'your unit'; $Ttypea = 'units'; } LaravelLocalization::getCurrentLocale() == 'ar' ? ($Tsubtype = 'العقارات') : ($Tsubtype = 'properties'); $Tcompound = null; $Tlocation = null; if (LaravelLocalization::getCurrentLocale() == 'ar') { $Tend = ", شاهد $Ttype الان"; } else { $Tend = ", view $Ttype now"; } if (LaravelLocalization::getCurrentLocale() == 'ar') { $Tmid = ", يمكنك عرض $Tsubtype و التواصل مع احد خبراء ريماكس المهاجر"; } else { $Tsubtype != 'properties' ? ($newTsubtype = 'the ' . $Tsubtype) : ($newTsubtype = $Tsubtype); $Tmid = ", you can view $newTsubtype and contact with one of remax elmohager agents"; } if (LaravelLocalization::getCurrentLocale() == 'ar') { $Tstart = "نقدم لك مجموعة من افضل $Tsubtype"; } else { $Tsubtype != 'properties' ? ($nTsubtype = $Tsubtype . 's') : ($nTsubtype = $Tsubtype); $Tstart = "we present to you a collection of best $nTsubtype"; } if ($Tcompound != null || $Tlocation != null) { $in = __('site.In'); } else { $in = null; } $desArr = [$Tstart, $in, $Tcompound, $Tlocation, $Tmid, $Tend]; $description = ''; foreach ($desArr as $des) { if ($des != null) { if (end($desArr) == $des) { $description .= $des; } else { $description .= $des . ' '; } } } if (LaravelLocalization::getCurrentLocale() == 'en') { $compoundTitle = 'Compounds'; } if (LaravelLocalization::getCurrentLocale() == 'ar') { $compoundTitle = 'كمبوندات'; } $seoRow = App\SeoPages::where('path', url()->current())->first(); if($seoRow == null) $seoRow = ''; if(count(request()->segments()) == 3){ $mcom = App\Compound::where('compound_name_en', str_replace('-', ' ', request()->segments()[2])) ->orWhere('compound_name_ar', str_replace('-', ' ', request()->segments()[2])) ->first(); }else{ $mcom = App\Compound::where('compound_name_en', str_replace('-', ' ', request()->segments()[1])) ->orWhere('compound_name_ar', str_replace('-', ' ', request()->segments()[1])) ->first(); } $seoRow = App\SeoPages::where('path', url()->current())->first(); if ($seoRow == null) { $seoRow = ''; } if ($lastSegment == 'custom-search') { $user = auth()->guard('web')->user()?->id; } else { $user = 'none'; } if (!isset($landingPage)) { $landingPage = (object) ['slug_en' => null, 'slug_ar' => null]; } if (count(request()->segments()) == 3) { $com_name = request()->segments()[2]; } else { $com_name = request()->segments()[1]; } // Apply all replacements sequentially $com_name = str_replace('-cities', '', $com_name); $com_name = str_replace('-compounds', '', $com_name); $com_name = str_replace('-districts', '', $com_name); $com_name = str_replace('-مدن', '', urldecode($com_name)); $com_name = str_replace('-احياء', '', urldecode($com_name)); $com_name = str_replace('-كمبوندات', '', urldecode($com_name)); $com_name = str_replace('-', ' ', trim($com_name)); $com = App\Compound::where('compound_name_en', $com_name)->orWhere('compound_name_ar', $com_name)->first(); if(empty($com))$dis = App\District::where('district_name_en', $com_name)->orWhere('district_name_ar', $com_name)->first(); if(empty($dis))$cit = App\City::where('city_name_en', $com_name)->orWhere('city_name_ar', $com_name)->first(); if(empty($cit))$gov = App\Governorate::where('governorate_name_en', $com_name)->orWhere('governorate_name_ar', $com_name)->first(); if (!empty($cit) && (str_contains(url()->current(),'compounds') || str_contains(urldecode(url()->current()),'كمبوندات'))) { if (request()->segments()[0] == 'ar') { $opposite_slug = str_replace(' ', '-', $cit->governorate->governorate_name_en.'/'.$cit->city_name_en.'-compounds'); } if (request()->segments()[0] == 'en') { $opposite_slug = str_replace(' ', '-', $cit->governorate->governorate_name_ar.'/'.$cit->city_name_ar.'-كمبوندات'); } } if (!empty($cit) && (str_contains(url()->current(),'districts') || str_contains(urldecode(url()->current()),'احياء'))) { if (request()->segments()[0] == 'ar') { $opposite_slug = str_replace(' ', '-', $cit->governorate->governorate_name_en.'/'.$cit->city_name_en.'-districts'); } if (request()->segments()[0] == 'en') { $opposite_slug = str_replace(' ', '-', $cit->governorate->governorate_name_ar.'/'.$cit->city_name_ar.'-احياء'); } } if (!empty($gov)) { if (request()->segments()[0] == 'ar') { $opposite_slug = str_replace(' ', '-', 'govs/'.$gov->governorate_name_en.'-cities'); } if (request()->segments()[0] == 'en') { $opposite_slug = str_replace(' ', '-', 'govs/'.$gov->governorate_name_ar.'-مدن'); } } if(urldecode(url()->current()) == 'https://www.nileestate.com/ar/المحافظات' || urldecode(url()->current()) == 'https://nileestate.com/ar/المحافظات'){ $opposite_slug = 'govs'; }elseif(url()->current() == 'https://nileestate.com/en/govs'){ $opposite_slug = 'المحافظات'; } if(!isset($opposite_slug)) return redirect('/'); @endphp @section('metatags') @if(!empty($seoRow)) @endif @if((str_contains(url()->current(), '/govs') || str_contains(urldecode(url()->current()), '/المحافظات' )) && count(request()->segments()) == 2) @else @endif @endsection @if (empty($seoRow->title)) @section('title')
{{ $gov['cities'] . ' ' . __('site.Cities') }}
@endif @if ($gov['properties'] > 0){{ $gov['properties'] . ' ' . __('site.Properties') }}
@endif{{ $area['districts'] . ' ' . __('site.district') }}
@endif @if ($area['compounds'] > 0){{ $area['compounds'] . ' ' . __('site.compound') }}
@endif @if ($area['properties'] > 0){{ $area['properties'] . ' ' . __('site.Properties') }}
@endif{{ $dist['compounds'] . ' ' . __('site.compound') }}
@endif @if ($dist['properties'] > 0){{ $dist['properties'] . ' ' . __('site.Properties') }}
@endif{{ $comp['properties'] . ' ' . __('site.Property') }}
@endif