Update schedule process to allow toggling/triggering via UI
This commit is contained in:
parent
02fe49892d
commit
036bea2b94
18 changed files with 280 additions and 221 deletions
|
@ -31,6 +31,23 @@ class ScheduleRepository extends EloquentRepository implements ScheduleRepositor
|
|||
return $this->getBuilder()->withCount('tasks')->where('server_id', '=', $server)->get($this->getColumns());
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the tasks relationship onto the Schedule module if they are not
|
||||
* already present.
|
||||
*
|
||||
* @param \Pterodactyl\Models\Schedule $schedule
|
||||
* @param bool $refresh
|
||||
* @return \Pterodactyl\Models\Schedule
|
||||
*/
|
||||
public function loadTasks(Schedule $schedule, bool $refresh = false): Schedule
|
||||
{
|
||||
if (! $schedule->relationLoaded('tasks') || $refresh) {
|
||||
$schedule->load('tasks');
|
||||
}
|
||||
|
||||
return $schedule;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a schedule model with all of the associated tasks as a relationship.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue