web.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Http\Request;
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Web Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register web routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | contains the "web" middleware group. Now create something great!
  11. |
  12. */
  13. Route::get('/', function (Request $request) {
  14. if (config('v2board.app_url') && config('v2board.safe_mode_enable', 0)) {
  15. if ($request->server('HTTP_HOST') !== parse_url(config('v2board.app_url'))['host']) {
  16. abort(403);
  17. }
  18. }
  19. $renderParams = [
  20. 'title' => config('v2board.app_name', 'V2Board'),
  21. 'theme' => config('v2board.frontend_theme', 'v2board'),
  22. 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
  23. 'theme_header' => config('v2board.frontend_theme_header', 'dark'),
  24. 'theme_color' => config('v2board.frontend_theme_color', 'default'),
  25. 'background_url' => config('v2board.frontend_background_url'),
  26. 'version' => config('app.version'),
  27. 'description' => config('v2board.app_description', 'V2Board is best'),
  28. 'crisp_id' => config('v2board.frontend_customer_service_method') === 'crisp' ? config('v2board.frontend_customer_service_id') : ''
  29. ];
  30. return view('theme::' . config('v2board.frontend_theme', 'v2board') . '.dashboard', $renderParams);
  31. });
  32. Route::get('/' . config('v2board.frontend_admin_path', 'admin'), function () {
  33. return view('admin', [
  34. 'title' => config('v2board.app_name', 'V2Board'),
  35. 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
  36. 'theme_header' => config('v2board.frontend_theme_header', 'dark'),
  37. 'theme_color' => config('v2board.frontend_theme_color', 'default'),
  38. 'backgroun_url' => config('v2board.frontend_background_url'),
  39. 'verison' => config('app.version')
  40. ]);
  41. });