relation = $relation; $this->whereCondition = $whereCondition; $this->whereType = $whereType; $this->entityId = $entityId; } public function apply($query) { $query->where('invoices.contact_id', '=', $this->entityId); } }