<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\CMSPages;
use App\Post;
use DB;
use Facades\App\Repository\Setting;
use App\Pages;
use App\Team;
use App\WidgetSection;
use App\Widgets;

class AboutController extends FrontController {

    public function __construct() {
        $this->breadcrumbs = $this->getBreadcrumbs();
        $this->breadcrumbs[1]['link'] = "#_";
        $this->breadcrumbs[1]['name'] = "About";
    }

    public function index() {
        
        
         $key = "about";
         $data["model"] = Pages::where("Template", "About")->where('Status','Enabled')->first();
         $data["sec3"]= Widgets::where('code','about_sec_3')->first();
         $data["sec4"]= Widgets::where('code','about_sec_4')->first();
         $data["sec5"]= Widgets::where('code','index_sec_7')->first();
         $data["sec6"]= Widgets::where('code','index_sec_2')->first();
         $data["sec7"]= Widgets::where('code','index_sec_4')->first();
         $data["latests"] = Post::orderBy(DB::raw('RAND()'))->limit(3)->get();
         $data["leaders"] = Team::where('team_role','leader')->orderBy('position', 'ASC')->get();
         $data["stafs"] = Team::where('team_role','staff')->orderBy('position', 'ASC')->get();
         $data["headerClass"]='';
        return view('front/about',$data);
    }



    
}
