Skip to content Skip to sidebar Skip to footer

Use React At Laravel

I'm start react learning, I've a question. Can I use react in Laravel ? Is it possible to work with react instead of jQuery? Should I use API for using laravel in react? Can react

Solution 1:

You can just use this command with Laravel to scaffold frontend.

php artisan preset react

put all your react.js component files in resources/assets/ folder and give rest of this things to work by laravel.

To get deep dive into this here are some useful links:

https://laravel.com/docs/5.7/frontend

https://blog.pusher.com/react-laravel-application/

Solution 2:

You can use React.js with Laravel. In Laravel you would create API and then you can send calls from React.js and get JSON data from API-s.

I have created Boilerplate project where React is integrated with Laravel. Follow instructions and enjoy.

Question is old but I hope it will help someone in future!

https://github.com/aldinkole/Laravel-v8.52-and-React-v17.0.2-Boilerplate

Solution 3:

Instead React is a front library you can use it a Replacement of jQuery thats how i learned React JS.

Eg:

Option 1 : use Laravel Authentication and blade views and Inside Blade views try to implement React for CRUD operation or form submit. Use CDN react links to get the dependencies. (Easy way of implementing a react functionality)

Option 2 : you can create a whole react application using create-react-app : https://github.com/facebook/create-react-app#creating-an-app

But for both options we need a Laravel REST API's to Manipulate the data's

Solution 4:

You can access your all of question by and article in two parts:

  1. Part-1
  2. Part-2

But If I wanna write an app, I use REST architecture for it, write backend by laravel and write frontend by react and then publish both in a separate stack. react app just call APIs that laravel gave to it.

Post a Comment for "Use React At Laravel"