mercredi 9 mars 2016

Laravel Model conditional formatting

I have a database and model called Vote_actions that looks like this:

  • id
  • group_id
  • user_id
  • action_type
  • anonymous (boolean)

User can ask to be anonymous (that would make the boolean value to be true).If that is the case, I want to change the group_id and user_id from the returned model to -1.

Is there a way in laravel that I can do it ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire