<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\View;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class GuestController extends Controller
{
    public function home()
    {
        return view('guest.welcome');
    }

    public function faq($locale)
    {
        $view = sprintf('guest.faq-%s', $locale);
        if (!View::exists($view)) {
            throw new NotFoundHttpException(sprintf('FAQ for locale « %s » doesn\'t exist.', $locale));
        }

        return view($view);
    }

    public function privacy()
    {
        return view('guest.privacy');
    }
}