pirep->user->state !== UserState::ACTIVE) { $old_state = $event->pirep->user->state; $event->pirep->user->state = UserState::ACTIVE; $event->pirep->user->save(); event(new UserStateChanged($event->pirep->user, $old_state)); } } }