?php use Illuminate\Support\Facades\Route; // API routes Route::prefix('api')->group(function () { // Define your API routes here }); // Catch-all route for React app Route::get('/{any}', function () { return view('app'); })->where('any', '.*');