<?php

namespace App\Http\Controllers\LangSwitcher;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class LanguageController extends Controller
{
    public function changeLanguage(Request $request)
    {
        $locale = $request->input('locale');
        if (in_array($locale, ['az', 'ru', 'en'])) {
            session(['app-locale' => $locale]);
        }
        return back();
    }
}
