public function run() { $send = $this->check(); $toUpdate = Subscription::whereIn('id', $this->subscriptionIds)->get(); foreach ($toUpdate as $subscription) { $subscription->touch(); } return $send; }
public function listUnsubscribe(UserList $userList) { if (!isset($userList->id)) { return ['error' => '404']; } $user = Auth::user(); $subscription = Subscription::whereUserListId($userList->id)->whereUserId($user->id)->first(); if (is_object($subscription)) { $subscription->delete(); } $customList = new CustomList($userList); if ($customList->error()) { return $customList->error(); } return $customList->getCustomList(); }