public function revokeBadge($badge) { if (is_array($badge)) { $revokeReason = $badge['reason']; $badge = Badge::findOrFail($badge['model']->id); } if ($badge->count() && empty($badge->revoked_at)) { $this->getBadgePivotBuilder($badge->id)->update(['revoke_reason' => $revokeReason, 'revoked_at' => Carbon::now()]); } }