web.php 1.8 KB

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