web.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_path' => '/theme/' . config('v2board.frontend_theme', 'v2board') . '/assets/',
  23. 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
  24. 'theme_header' => config('v2board.frontend_theme_header', 'dark'),
  25. 'theme_color' => config('v2board.frontend_theme_color', 'default'),
  26. 'background_url' => config('v2board.frontend_background_url'),
  27. 'version' => config('app.version'),
  28. 'description' => config('v2board.app_description', 'V2Board is best'),
  29. 'crisp_id' => config('v2board.frontend_customer_service_method') === 'crisp' ? config('v2board.frontend_customer_service_id') : ''
  30. ];
  31. return view('theme::' . config('v2board.frontend_theme', 'v2board') . '.dashboard', $renderParams);
  32. });
  33. Route::get('/' . config('v2board.frontend_admin_path', 'admin'), function () {
  34. return view('admin', [
  35. 'title' => config('v2board.app_name', 'V2Board'),
  36. 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
  37. 'theme_header' => config('v2board.frontend_theme_header', 'dark'),
  38. 'theme_color' => config('v2board.frontend_theme_color', 'default'),
  39. 'backgroun_url' => config('v2board.frontend_background_url'),
  40. 'verison' => config('app.version')
  41. ]);
  42. });