<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Media as mMedia;
use App\General as mGeneral;
use App\Settings as mSetting;
use App\Pagename as mPage;

class MentionLegales extends Controller
{
  public function index()
  {
    $page = mPage::where('key', 'mentionslegales')->first();
		if( mSetting::where(['setting_name'=>'mentionsLegales'])->first() ):
	    $data['mentions_legales_data'] = explode('|',mSetting::where(['setting_name'=>'mentionsLegales'])->first()->setting_value);
	  else:
	    $data['mentions_legales_data'] = "";
	  endif;
    $data['banner'] = mMedia::where(['media_page' => 'mentionslegales', 'media_section' => 'banner-header'])->first();
    $data['contents'] = mMedia::where(['media_page' => 'mentionslegales', 'media_section' => 'content'])->orderBy('temp_id','asc')->get();
    $data['page'] = 'mentionslegales';

    return view('mentions-legales')->with($data);
  }
}
