Using the method updateOrCreate, is there a way to find out which record has been updated or created?
updateOrCreate
UPDATE: I need to use this function to return 201for the created record or 204for the updated record.
201
204
Thank.
Since it updateOrCreatereturns an instance of the model. https://github.com/laravel/framework/blob/5.4/src/Illuminate/Database/Eloquent/Builder.php#L374
, , : $instance->wasRecentlyCreated https://github.com/laravel/framework/blob/5.3/src/Illuminate/Database/Eloquent/Model.php#L1593
$instance->wasRecentlyCreated
Source: https://habr.com/ru/post/1678093/More articles:statepace.SARIMAX: why does the model use all the data in training mode and predict the range of the train model - pythonJava-8: how to sort a map (based on values) using Map.Entry # compareingByValue while ignoring case sensitivity? - javaJava IO: Why does the console display a numeric representation of a linear feed when reading from stdin? - javaHow to add com.google.gson.JsonArray to a specific index? - javaWhy is Vue.js using VDOM? - javascriptDjango ORM access optimization with filter - pythonGoogle Play Games 2017: How do I invite someone to a multiplayer match? - androidqt sql datatype (QVariant) for type BINARY of arbitrary length - c ++Не удалось настроить uwgi через супервизор "uwsgi: uwsgi_00: ERROR (ошибка появления)" - supervisordConstraintLayout: проблема z-index - androidAll Articles