getBuilder()->with('server.user', 'schedule')->findOrFail($id, $this->getColumns()); } catch (ModelNotFoundException $exception) { throw new RecordNotFoundException; } } /** * Returns the next task in a schedule. * * @param int $schedule * @param int $index * @return \Pterodactyl\Models\Task|null */ public function getNextTask(int $schedule, int $index) { return $this->getBuilder()->where('schedule_id', '=', $schedule) ->where('sequence_id', '=', $index + 1) ->first($this->getColumns()); } }