where('user_id', $this->id)->delete(); } /** * Boot the trait. */ protected static function bootDeletesUserSessions() { static::updated(function ($user) { // Check if password was changed if ($user->isDirty('password')) { $user->deleteAllSessions(); } }); } }