samedi 30 septembre 2017

Laravel eloquent updateOrCreate(), do something only if create?

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?



via Chebli Mohamed

1 commentaire:

  1. I was able to get around this by getting the ID of the last entry prior to the updateOrCreate. After, if the ID was higher, I did the secondary action.

    RépondreSupprimer