can you provide the link to your hosted app?
Language switch not working when installed on shared hosting
Hi everyone,
I have made a website in Laravel, a multilingual website, so far English and French. To change the language there is method thats ets the value in the sessions and it's called in the Route Route::get('home/lang/{any}','HomeController@getLang');
HomeController
public function getLang( Request $request , $lang) { $request->session()->put('lang', $lang); return Redirect::back(); } In the index fucntion of the same controller it is:
public function index( Request $request) { \App::setLocale(\Session::get('lang')); }
With this code Laravel is able to translate the strings. It works like a charm in my local PC, but when I install in a shared server (in my case, Hostgator), it doesn't work. When I click on the webpage to switch to another language, it's just refreshing the page and the same original language shows. Why does this happen? What do I have to do for this to work in a shared hosting? Is that a kind of protection Laravel has?
I will appreciate any help.
Best wishes, Ariel
Please or to participate in this conversation.