<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TranslateController extends Controller
{
    public function changeLocale(Request $request)
    {
        if ($request->language == null) {
            $language = 'id';
        } else {
            $language = $request->language;
        }

        session(['selected_language' => $language]);

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