Skip to content

Commit f14896f

Browse files
committed
Add demo for scalar datasources
1 parent 247a069 commit f14896f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/DocumentTemplates/InvoiceTemplate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ protected function dataSources()
1717
return [
1818
$this->dataSource($this->testOrders[0], 'order', true, 'orders'),
1919
$this->dataSource(new User(), 'user'),
20+
$this->dataSource('', 'text'),
21+
$this->dataSource(null, 'number'),
2022
];
2123
}
2224

23-
}
25+
}

app/Http/Controllers/DemoDocumentTemplatesController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ protected function getTemplateData()
3737
'user' => Auth::user(),
3838
'orders' => $this->getTestOrders(),
3939
'foods' => $this->getFood(),
40-
'dates' => $this->getDates()
40+
'dates' => $this->getDates(),
41+
'text' => 'coders',
42+
'number' => 42
4143
];
4244
}
4345

0 commit comments

Comments
 (0)