SinglePageController.php 793 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. 'locales' => collect(config("2fauth.locales"))->toJson(),
  29. ]);
  30. }
  31. }