前端路由配置容易和 用laravel作为后端的开发
解决方案:
SpaContriller.php:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class SpaController extends Controller
{
    public function __invoke() {
        return view('index');
    }
}

web.php:

<?php

use Illuminate\Support\Facades\Route;

Route::get('{path}', 'SpaController')->where(['path'=>'.*']);

前端box
75 声望1 粉丝