public function scopePrivateFbMessages($query, $contact) { return $query->where('origin', 'Facebook private')->where('contact_id', $contact->id); }