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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners