<?php

namespace App\Http\Controllers;

use App;

class LocalizationController extends Controller
{
    public function setLocale($locale){
        if (! in_array($locale, ['en', 'ar'])) {
            abort(400);
        }
        App::setlocale($locale);
        session()->put('locale', $locale);
        return redirect()->back();
    }
}
