How can I edit Laravel's default login page to add a feature for lanugage change. Right now I use this package https://github.com/mcamara/laravel-localization , but the problem is it doesn't cover login form. So, right now I have something like this: http://localhost/en/userProfile, or http://localhost/de/userProfile ... But for login it is just http://localhost/login ...
In login.blade.php I have this:
<select id="changeLang">
<option value="">{{ trans('language.languageChange') }}</option>
<option value="/en">English</option>
<option value="/de">Deutsch</option>
</select>
And this:
<script type="text/javascript">
$('#changeLang').change(function (e) {
var locAppend = $(this).find('option:selected').val(),
locSnip = "login";
window.location.href = locAppend + "/" + locSnip;
});
</script>
This script reloads the page with selected language. Right now it shows an error that route is not existing. Also, I need to be able to hold selected language after login. So, when user selects english in login form, I want it to be selected for the whole application.