Skip to content

Commit

Permalink
Fix call operator in chat
Browse files Browse the repository at this point in the history
- Use Psid instead of app id
- Fix the variables
  • Loading branch information
tanftw authored Nov 26, 2018
1 parent 1954e03 commit 57380d9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Shared/CanLearn.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ public function says($messages, $attributes = [], $lead_ids = null)

if ( ! is_null($lead_ids)) {
$lead_ids = (array) $lead_ids;

$leads = Lead::withTrashed()->whereIn('id', $lead_ids)->get();
$leads = Lead::withTrashed()->whereIn('user_id', $lead_ids)->get();

if (empty($leads) || $leads === null) {
return;
}

$leads->each(function ($lead) {
Conversation::set('lead', $lead);
$leads->each(function ($lead) use ($messages, $attributes) {
$this->request->sendMessages($messages, $attributes, $lead);
});
} else {
Expand Down Expand Up @@ -215,4 +213,4 @@ public function simulate($input)
{
// Todo: Add simulate method to make app more easy to test
}
}
}

0 comments on commit 57380d9

Please sign in to comment.