mardi 22 mai 2018

How to update on data restauration in a Laravel Eloquent model?

I would like to be able to run some code when an Eloquent model is loaded from my database. fill() does not seem to be the right method as it is not code when I load get my object from a query.

Context aka "why would someone want to do that"

I wish my object to have some complex attributes which are currently represented as public properties, persisted as JSON on save and I need to restore them back on loading from database.

Laravel: 5.6



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

Aucun commentaire:

Enregistrer un commentaire