Sådan gengives data i grafskabelon
$graph = view('graph')->with('graph', $graph);
Og for at returnere gengivet data til nyheder
return view('coin.news', compact('graph','news'));
Endelig kode
$graph = Charts::database(Graph::find(1),'line','highcharts')
->title('Tokens')
->ElementLabel('Coins Sold')
->Responsive(true)
->dimensions(1000,500)
->data(Graph::find(1));
$news = News::all();
$graph = view('graph')->with('graph', $graph);
return view('coin.news', compact('graph','news'));