Пример #1
0
 public function run()
 {
     $send = $this->check();
     $toUpdate = Subscription::whereIn('id', $this->subscriptionIds)->get();
     foreach ($toUpdate as $subscription) {
         $subscription->touch();
     }
     return $send;
 }
Пример #2
0
 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();
 }