I use in my laravel 5.5 app Model::updateOrCreate()
, it works, but by 1 parameter I wish to do something only if entry is creating and not updating model, is this possible?
The updateOrCreate returns a model instance where you can check for recent creation
An example could be the following pseudo code
$model = Model::updateOrCreate($data);
if($model->wasRecentlyCreated) {
// Do logic only when the model was created
}