Check out example codes for "laravel updateorcreate multiple records". It will help you in understanding the concepts better.

Code Example 1

// If there's a flight from Oakland to San Diego, set the price to $99.
// If no matching model exists, create one.
$flight = App\Flight::updateOrCreate(
    ['departure' => 'Oakland', 'destination' => 'San Diego'],
    ['price' => 99]
);

Learn ReactJs, React Native from akashmittal.com