File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Akaunting \Apexcharts \Traits ;
4
4
5
+ use Illuminate \Http \JsonResponse ;
6
+
7
+ /** @mixin \Akaunting\Apexcharts\Chart */
5
8
trait Formatter
6
9
{
7
- public function toJson ()
10
+ public function toJson (): JsonResponse
8
11
{
9
- return response ()->json ([
10
- 'id ' => $ this ->id (),
11
- 'options ' => $ this ->getOptions (),
12
- ]);
12
+ return response ()->json ($ this ->toVue ());
13
13
}
14
14
15
15
public function toVue (): array
16
16
{
17
17
return [
18
+ 'id ' => $ this ->getId (),
18
19
'height ' => $ this ->getHeight (),
19
20
'width ' => $ this ->getWidth (),
20
21
'type ' => $ this ->getType (),
21
- 'options ' => $ this ->getOptions (),
22
- 'series ' => json_decode ( $ this ->getSeries () ),
22
+ 'options ' => json_decode ( $ this ->getOptions (), true ),
23
+ 'series ' => $ this ->getSeries (),
23
24
];
24
25
}
25
26
}
You can’t perform that action at this time.
0 commit comments