First steps
This commit is contained in:
25
app/Http/Controllers/WebsiteController.php
Normal file
25
app/Http/Controllers/WebsiteController.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
class WebsiteController extends Controller
|
||||
{
|
||||
private function setLang($lang)
|
||||
{
|
||||
if (! in_array($lang, ['de', 'en'])) {
|
||||
$lang = 'en';
|
||||
}
|
||||
|
||||
App::setLocale($lang);
|
||||
}
|
||||
|
||||
//
|
||||
public function index(Request $request, $lang){
|
||||
$this->setLang($lang);
|
||||
|
||||
return view('layout.app', ['page' => 'content.index']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user