2FAuth/app/Http/Controllers/SinglePageController.php

45 lines
1.1 KiB
PHP
Raw Normal View History

2019-05-28 17:29:15 +02:00
<?php
namespace App\Http\Controllers;
2021-12-01 13:47:20 +01:00
use App\Services\SettingService;
use Illuminate\Support\Facades\App;
2019-05-28 17:29:15 +02:00
class SinglePageController extends Controller
{
/**
* The Settings Service instance.
*/
2021-12-01 13:47:20 +01:00
protected SettingService $settingService;
/**
* Create a new controller instance.
*
*/
2021-12-01 13:47:20 +01:00
public function __construct(SettingService $settingService)
{
2021-12-01 13:47:20 +01:00
$this->settingService = $settingService;
}
2019-05-28 17:29:15 +02:00
/**
* return the main view
* @return view
*/
public function index()
{
2021-12-01 13:47:20 +01:00
return view('landing')->with([
'appSettings' => $this->settingService->all()->toJson(),
'appConfig' => collect([
'proxyAuth' => config("auth.defaults.guard") === 'reverse-proxy-guard' ? true : false,
'proxyLogoutUrl' => config("2fauth.config.proxyLogoutUrl") ? config("2fauth.config.proxyLogoutUrl") : false,
])->toJson(),
'lang' => App::currentLocale(),
2022-05-10 08:57:45 +02:00
'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
'locales' => collect(config("2fauth.locales"))->toJson()
2021-12-01 13:47:20 +01:00
]);
2019-05-28 17:29:15 +02:00
}
}