<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TranslateController extends Controller
{
    public function changeLocale(Request $request)
    {
        $language = $request->language == 'en' ? 'en' : 'id';
        session(['selected_language' => $language]);

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