mercredi 29 juin 2016

How to get the total number of updated fields in laravel 5.1?

I need to save the number of fields updated after an update operation is performed on a model and its related models.

Suppose I have a user profile edit form. On that form I allow the user to update its firtname, lastname, password.

The User model has email and password fields and few other fields as well.

The UserProfile model has firstname, last name and other fields as well.

The User model is associated with UserProfiles model with hasOne association.

There are some ManyToMany and hasMany associations as well.

If the user updates firstname and password I need to show user the "number of fields changed : 2".

Is there any Laravel 5 way or package to do so.

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire