jeudi 21 février 2019

How to fix htmlspecialchars() error in laravel?

I facing below error in laravel which is

htmlspecialchars() expects parameter 1 to be string, array given 

Which is appearing when I return data as array

$yAxis = array_reverse($data_array['counter']);
$xAxis = array_reverse($data_array['date']);

Instead of

$yAxis = collect($graphData)->pluck('counter');
$xAxis = collect($graphData)->pluck('date'); 

Actually I can't return data as collection because I am modifying before passing to view, so how pass array or convert into collect in the end that I fix the issue. I would like to appreciate if you kindly guide me about that. Thank you so much.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire