public function applyFilterOnEntity($entity, $foreignRecord) { if (!$this->filter || !$foreignRecord) { return; } $evalResult = $this->eval($this->filter, $foreignRecord); if (!$evalResult) { return; } $entity->where(Raw::raw($evalResult)); }
public function getWaiting() { return $this->queue->where('execute_at', date('Y-m-d H:i:s'), '<')->where(Raw::raw('waiting_id IS NULL OR waiting_id IN (SELECT id FROM queue WHERE status = \'finished\')'))->status(['created', 'failed'])->all(); }