rivkamak
asked on
Laravel tracking what was changed.
I am a simple form with a few field displaying a person's contact information and when they edit it, I send the information out with ajax, is there a way with laravel that I can track what was the original form vs just the new information that is being sent out?
ASKER
Let's say, I have a phone number
111-111-1111
and the user comes in and change it to
222-222-2222
i want to send a proc out notification to the manager that someone changed their phone number
old number : is ____
new number is $_POST['number']
is there a way to pull what was there before?
111-111-1111
and the user comes in and change it to
222-222-2222
i want to send a proc out notification to the manager that someone changed their phone number
old number : is ____
new number is $_POST['number']
is there a way to pull what was there before?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you want the most current value, your query uses something like ORDER BY id DESC LIMIT 1.
When you want the historical perspective (to track changes) your query uses ORDER BY id DESC. This returns a 1-or-more results collection, and you can iterate through it to find the changes.