<?php

namespace App\Http\Controllers\Public;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;

class LocaleController extends Controller
{
    public function switch(string $locale)
    {
        if (in_array($locale, ['en', 'bn'])) {
            Session::put('locale', $locale);
        }

        return redirect()->back();
    }
}
