Skip to content

Commit cf7f36c

Browse files
committed
Always include the tasks with a schedule
1 parent 1e0d630 commit cf7f36c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

app/Models/Schedule.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ class Schedule extends Validable
4040
*/
4141
protected $table = 'schedules';
4242

43+
/**
44+
* Always return the tasks associated with this schedule.
45+
*
46+
* @var array
47+
*/
48+
protected $with = ['tasks'];
49+
4350
/**
4451
* Mass assignable attributes on this model.
4552
*

app/Transformers/Api/Client/ScheduleTransformer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class ScheduleTransformer extends BaseClientTransformer
1313
*/
1414
protected $availableIncludes = ['tasks'];
1515

16+
/**
17+
* @var array
18+
*/
19+
protected $defaultIncludes = ['tasks'];
20+
1621
/**
1722
* {@inheritdoc}
1823
*/

0 commit comments

Comments
 (0)