2018-11-21 12:40:34 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Frontend;
|
|
|
|
|
|
2022-08-05 11:26:42 +00:00
|
|
|
|
// use Illuminate\Http\Request;
|
|
|
|
|
// use Illuminate\Support\Facades\Input;
|
|
|
|
|
// use Illuminate\Support\Facades\Session;
|
|
|
|
|
// use Illuminate\Support\Facades\App;
|
2018-11-21 12:40:34 +00:00
|
|
|
|
use Illuminate\Support\Facades\Redirect;
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
|
|
|
|
|
class LocalizationController extends Controller
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// public function index(Request $request,$locale){
|
|
|
|
|
// //set’s application’s locale
|
|
|
|
|
// app()->setLocale($locale);
|
|
|
|
|
|
|
|
|
|
// //Gets the translated message and displays it
|
|
|
|
|
// echo trans('lang.msg');
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
return view('localization.index');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setLocale($lang)
|
|
|
|
|
{
|
|
|
|
|
//if action is post method:
|
|
|
|
|
//$lang = Input::get('language');
|
|
|
|
|
|
|
|
|
|
|
2018-11-27 11:21:42 +00:00
|
|
|
|
// //Session::put('locale', $lang);
|
|
|
|
|
// Session::put(['locale' => $lang]);
|
|
|
|
|
|
2018-11-21 12:40:34 +00:00
|
|
|
|
|
|
|
|
|
//return redirect(url(URL::previous()));
|
|
|
|
|
return Redirect::back();
|
|
|
|
|
// echo trans('document.msg');
|
|
|
|
|
}
|
|
|
|
|
}
|