diff --git a/app/Models/Schedule.php b/app/Models/Schedule.php index 44bed1213..21cad0e59 100644 --- a/app/Models/Schedule.php +++ b/app/Models/Schedule.php @@ -40,6 +40,13 @@ class Schedule extends Validable */ protected $table = 'schedules'; + /** + * Always return the tasks associated with this schedule. + * + * @var array + */ + protected $with = ['tasks']; + /** * Mass assignable attributes on this model. * diff --git a/app/Transformers/Api/Client/ScheduleTransformer.php b/app/Transformers/Api/Client/ScheduleTransformer.php index 2c2bbb85b..43e35ed42 100644 --- a/app/Transformers/Api/Client/ScheduleTransformer.php +++ b/app/Transformers/Api/Client/ScheduleTransformer.php @@ -13,6 +13,11 @@ class ScheduleTransformer extends BaseClientTransformer */ protected $availableIncludes = ['tasks']; + /** + * @var array + */ + protected $defaultIncludes = ['tasks']; + /** * {@inheritdoc} */