Skip to content

Commit b23afce

Browse files
Ionys320jbrooksuk
andcommitted
feat(metric): Simplify the code for setting metric/period data in Alpine
Co-authored-by: James Brooks <[email protected]>
1 parent f019e14 commit b23afce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

resources/views/components/metric.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<script>
3333
document.addEventListener('alpine:init', () => {
3434
Alpine.data('chart', () => ({
35-
metric: <?php echo json_encode($metric); ?>,
36-
period: <?php echo json_encode($metric->defaultView); ?>,
35+
metric: {{ Js::from($metric) }},
36+
period: {{ Js::from($metric->defaultView) }},
3737
points: [
3838
[],
3939
[],

0 commit comments

Comments
 (0)