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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners