SinglePageController.php 874 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. 'lang' => App::currentLocale(),
  28. 'isDemoApp' => config("2fauth.config.isDemoApp") ? 'true' : 'false',
  29. 'locales' => collect(config("2fauth.locales"))->toJson(),
  30. ]);
  31. }
  32. }