Always include the tasks with a schedule

This commit is contained in:
Dane Everitt 2020-03-22 13:57:31 -07:00
parent 1e0d630e1f
commit cf7f36c950
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 12 additions and 0 deletions

View file

@ -40,6 +40,13 @@ class Schedule extends Validable
*/ */
protected $table = 'schedules'; protected $table = 'schedules';
/**
* Always return the tasks associated with this schedule.
*
* @var array
*/
protected $with = ['tasks'];
/** /**
* Mass assignable attributes on this model. * Mass assignable attributes on this model.
* *

View file

@ -13,6 +13,11 @@ class ScheduleTransformer extends BaseClientTransformer
*/ */
protected $availableIncludes = ['tasks']; protected $availableIncludes = ['tasks'];
/**
* @var array
*/
protected $defaultIncludes = ['tasks'];
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */