Here is how you use this method:
Model::updateOrCreate( ['primary_key' => 8], ['field' => 'value', 'another_field' => 'another value'] );
As the first parameter, pass an array of fields that are unique or in your case the primary key. Unusual fields here do not make sense, obviously, as if transmitting something along with the PC.
2nd param is an array of values ββthat should be updated / created, but ignored in a unique / pk search.
source share