34 lines
745 B
PHP
34 lines
745 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Bo;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
/**
|
|
* Dashboard Page
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function index()
|
|
{
|
|
return view('bo.pages.dashboard');
|
|
}
|
|
|
|
/**
|
|
* Chagne current locale on BO.
|
|
*
|
|
* @param string $lang
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function changeLang(string $lang): RedirectResponse
|
|
{
|
|
if (!\in_array($lang, config('app.locales'))) {
|
|
$lang = config('app.fallback_locale');
|
|
}
|
|
session()->put('lang', $lang);
|
|
return redirect()->back();
|
|
}
|
|
}
|