Ever since Laravel 9, a lot of new features and improvements have been included in Laravel. Furthermore, developer experience has been improved, especially with the introduction of https://vitejs.dev, a frontend asset bundler.
Integrating React into Laravel 9 has changed a bit with Vite as the new frontend asset bundler.
This tutorial is going to walk us through integrating ReactJS into Laravel from scratch.
Let's head there, modify and add the following lines: import { defineConfig } from "vite"; import laravel from "laravel-vite-plugin"; import react from "@vitejs/plugin-react"; //this line export default defineConfig({ plugins: [ laravel({ input: "resources/js/app.jsx", //this line }), react(), //this line ], }); Finally, let's create our welcome page.