Categories: php, reactjs, laravel

Send data to MySQL database using React Native and Laravel?

1 answer

I have a website application built with Laravel, I want to create a registration form into the React Native mobile app and send that data to the MySQL database to store in their respective columns.

What's the proper way of doing this?

All answers to this question, which has the identifier 61237939

The best answer:

This is a fairly open-ended question, but I'll provide a few basic pointers.

  • First, you'll want to do client-side validation of registration form data, checking for things like required fields, password length, etc. There are many ways of doing that, here is one:

  • Your (validated) form data will make a POST request, with the form data as the POST body, to an API endpoint you will create in Laravel:

  • The endpoint will do any validation that can only be done server-side. This depends on your application, but for instance if you are building a user registration form, you will want to check to see if there is already a user by that email address.

  • After validation, you'll want to save the data to the database with the laravel model you create for this form, if it doesn't already exist. The article above will show you how to do this.

Last questions

how do i remove the switch on my home screen?
how to edit the JS date and time to update atuomatically?
How to utilize data stored in a multidimensional array
Powermockito not mocking URL constructor in URI.toURL() method
Android Bluetooth LE Scanner only scans when phone's Location is turned on in some devices
docker wordpress container can't connect to mysql container
How can I declare a number in java that is more than 64-bits? [duplicate]
Optaplanner solutionClass entityCollectionProperty should never return null error when simple JSON object passed to controller
Anylogic, get the time a pedestrain is in a queue
How do I fix this syntax issue with my .flex file?
Optimizing query in PHP
How to find the highest number of a column and print two columns of that row in R?
Ideas on “Error: Type is referenced as an interface from”?
JCIFS SmbFile.exists() and SmbFile.isDirectory() return false when it exists and I can listFiles()
PHP total order
Laravel booking system design
neural net - undefined column selected
How to indicate y axis does not start from 0 in ggplot?
Fragments in backStack
Spinner how to change the data