where("job", $job . '@handle'); } public function scopeOfJobs($query, $jobs) { foreach ($jobs as &$job) { $job .= '@handle'; } return $query->whereIn("job", $jobs); } public function scopeOfHostingId($query, $hostingId) { return $query->where("rel_id", $hostingId) ->where("rel_type", "hosting"); } public function scopeOfCustomId($query, $id) { return $query->where("custom_id", $id); } public function scopeWaiting($query) { return $query->whereIn("status", ['waiting', "running", ""]); } public function scopeFinished($query) { return $query->where("status", "finished"); } public function scopeOfParentId($query, $parentId) { return $query->where("parent_id", $parentId); } public function scopeOfId($query, $id) { return $query->where("id", $id); } }