@extends('layouts.front')
@section('meta')
<title>{{$page->title}}</title>
<meta property="og:title" content="{{$page->title}}"/>
@endsection
@section('contents')

@php
    // বর্তমান ভাষা আইডি বের করো
    $language_id = Session::has('language')
        ? Session::get('language')
        : DB::table('languages')->where('is_default', '=', 1)->first()->id;

    // ঐ ভাষার পেজ বের করো (slug অনুযায়ী)
    $page = DB::table('pages')
        ->where('slug', $page->slug)
        ->where('language_id', $language_id)
        ->first();
@endphp

@if($page)
<!-- main div -->
<div class="mainDiv">
<div class="bgWHite">
  <div class="container">
    <div class="row">
      <!-- header -->
      <div class="col-sm-12 col-md-12 marginB20 hidden-xs marginT10">
        <h1 class="desktopCategoryTitle"><span class="titleLeftDesign1"></span> <a href="{{ url()->current() }}"><strong>{{ $page->title }}</strong></a></h1>
      </div>
      <div class="col-sm-12 col-md-12 paddingLR20 xs-paddingL15 marginB10 visible-xs paddingT10">
        <h1 class="sectionTitle displayInline border0 margin0 marginB0"><span class="titleLeftDesign1"></span> <a href="{{ url()->current() }}"><strong>{{ $page->title }}</strong></a></h1>
      </div>

      <div class="col-sm-12 col-md-12">
        <div class="marginB20 textBody">
          {!! $page->description !!}
        </div>
      </div>
    </div>
  </div>
</div>
</div>
<!-- main div end -->
@else
<!-- main div -->
<div class="mainDiv">
<div class="bgWHite">
  <div class="container">
    <div class="row">
      <div class="col-sm-12 col-md-12">
        <div class="text-center padding20 marginB30">
          <p class="colorBrand"><strong>{{ __('No content available for this language') }}</strong></p>
        </div>
      </div>
    </div>
  </div>
</div>
</div>
<!-- main div end -->
@endif

@endsection