Adding app/Http/Controllers/LocaleSessionController.php
This commit is contained in:
parent
e4fd735acb
commit
4b56c803a5
1 changed files with 19 additions and 0 deletions
19
app/Http/Controllers/LocaleSessionController.php
Normal file
19
app/Http/Controllers/LocaleSessionController.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LocaleSessionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Set locale
|
||||
*/
|
||||
public function store(Request $request, $locale)
|
||||
{
|
||||
if (array_key_exists($locale, config('lang'))) {
|
||||
$request->session()->put('locale', $locale);
|
||||
}
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue