mercredi 28 juin 2017

How to replicate soft deleting functionality?

I created a custom date column in my table, called finished_at. I want to replicate the functionality of soft deleting so that:

  1. Rows that have a NULL value for the finished_at column are not retrieved by default.
  2. If I want to retrieve rows with a NULL value, I add withFinished() to the query (like how soft delete has withTrashed()).

How can I do this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sRoIIA
via IFTTT

Aucun commentaire:

Enregistrer un commentaire