Answers for "add react to laravel project"

1

how to install react in laravel 8

composer require laravel/ui
php artisan ui react
php artisan ui react --auth
Posted by: Guest on September-02-2021
8

add react to laravel project

// in project directory, run this commands
composer require laravel/ui
php artisan ui react
php artisan ui react --auth

// add this 2 lines to ./resources/views/home.blade.php
// or whatever page you decide to be the first page to be run in laravel
<div id="example"></div>
<script src="{{ mix('js/app.js') }}"></script>

// every modification in react component, you have
// to run this command, to affect changes
npm run dev
Posted by: Guest on April-29-2022

Code answers related to "add react to laravel project"

Code answers related to "Javascript"

Browse Popular Code Answers by Language