1class UserObserver
2{
3
4
5 /**
6 * Listen to the User created event.
7 *
8 * @param \App\User $user
9 * @return void
10 */
11 public function updating(User $user)
12 {
13 if($user->isDirty('email')){
14 // email has changed
15 $new_email = $user->email;
16 $old_email = $user->getOriginal('email');
17 }
18 }
19
20}
21