Crud operation in Laravel with react js

Posted by

React project

First of all create react project

create a project using this command my project name

npx create-react-app frontend

then run these command also

npm install bootstarp   //to install bootstarp   
npm install react-router-dom  //for routing
npm install axios    // to get data from api

src/pages/create.js

src/pages/edit.js

src\pages\home.js

src\pages\view.js

src\http.js

src\index.js

src\app.js

Start this project by using “npm start”

In Laravel

create a project

composer create-project laravel/laravel:^9.0 <your project name> 

Create Resources controller

UserController.php

user.php

Create database by using “php artisan migration” .then set your filed name which want to create in table.In this case i am using flied name like (name,emailand password)

after that run this command “php artisan migrate

api.php

Route::resource('users',UserController::class);

Run react project by using this command “npm start”

Run laravel project by using this command “php artisan serve”

0 0 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
1
0
Would love your thoughts, please comment.x
()
x