SinglePageController.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Services\SettingService;
  4. use Illuminate\Support\Facades\App;
  5. class SinglePageController extends Controller
  6. {
  7. /**
  8. * The Settings Service instance.
  9. */
  10. protected SettingService $settingService;
  11. /**
  12. * Create a new controller instance.
  13. *
  14. */
  15. public function __construct(SettingService $settingService)
  16. {
  17. $this->settingService = $settingService;
  18. }
  19. /**
  20. * return the main view
  21. * @return view
  22. */
  23. public function index()
  24. {
  25. return view('landing')->with([
  26. 'appSettings' => $this->settingService->all()->toJson(),
  27. 'appConfig' => collect([
  28. 'proxyAuth' => config("auth.defaults.guard") === 'reverse-proxy-guard' ? true : false,
  29. 'proxyLogoutUrl' => config("2fauth.config.proxyLogoutUrl") ? config("2fauth.config.proxyLogoutUrl") : false,
  30. ])->toJson(),
  31. 'lang' => App::currentLocale(),
  32. 'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
  33. 'isTestingApp' => config("2fauth.config.isTestingApp") ? 'true' : 'false',
  34. 'locales' => collect(config("2fauth.locales"))->toJson()
  35. ]);
  36. }
  37. }