
Implementing Forms with Laravel, React, and Superagent
This article was originally published on bmf-tech.com . As the title suggests, we will implement an Ajax form using Laravel, React, and Superagent. The reason for choosing Superagent as the Ajax library is that I wanted to move away from jQuery, and I found it easier to understand than jQuery's Ajax. There seems to be a complicated concept called Promises, but we can set that aside for now and see if we can use it. From a web standards perspective, the Fetch API is considered cool, but it seems to have inconsistencies in implementation across different browser vendors, so I decided to avoid it. While I grumble about how chaotic the frontend can be, I would like to proceed with the discussion. What to Do Prepare an API with Laravel Set the FormRequest response to JSON Use Superagent to call Laravel's API with React → Check GET and POST What Not to Do Set up the build environment Set up React and Superagent Laravel Implementation Please excuse the random order... Routing Route::group(['p
Continue reading on Dev.to React
Opens in a new tab


