<?php

namespace App\Http\Controllers\Web;

use App\About;
use App\Http\Controllers\Controller;
use App\Team;

class AboutController extends Controller
{
    public function index()
    {

        $title = __('abouts.title');
        $about = About::first();
        $teams = Team::get(['name', 'job', 'image', 'social'])->toArray();
        $teams = count($teams) ? $teams : [];
        $statistics = $about && $about->statistics ? explode('@@', $about->statistics) : [];
        $details = $about && $about->details['details_'.getCurrentLocale()] ? explode('@@', $about->details['details_'.getCurrentLocale()]) : [];
        return view('web.abouts.index', compact('title', 'about', 'statistics', 'details', 'teams'));
    }
}
