web.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. ]);
  28. });
  29. Route::get('/admin', function () {
  30. return view('admin', [
  31. 'title' => config('v2board.app_name', 'V2Board'),
  32. 'theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
  33. 'theme_header' => config('v2board.frontend_theme_header', 'dark'),
  34. 'theme_color' => config('v2board.frontend_theme_color', 'default'),
  35. 'backgroun_url' => config('v2board.frontend_background_url'),
  36. 'verison' => config('app.version')
  37. ]);
  38. });