<?php

namespace App\Http\Controllers;
use App\Conteudo;
use App\Cliente;
use App\Http\Services\ClienteService;

class SiteController extends Controller
{
    public function index($section = 'index'){

        $elemento = null;

        if($section == 'index' || $section == 'sobrenos'){
            $elemento = Conteudo::find(1);
            return view('site.'.$section, ['section' => $section, 'elemento' => $elemento]);

        }
        else if($section == 'clientes'){
            $elemento = Cliente::all();
            $service = new ClienteService();
            $ordem = $service->ordem();
            return view('site.'.$section, ['section' => $section, 'elemento' => $elemento, 'ordem' => $ordem]);
        }
        else{
            return view('site.'.$section, ['section' => $section]);
        }

    }
}