Htmlspecialchars() Expects Parameter 1 To Be String, Array Given In Laravel
I have got this error in my Laravel blade template htmlspecialchars() expects parameter 1 to be string, array given I have tried to convert the array into string in blade templat
Solution 1:
{{}}
will be converted to echo()
by Blade template engine. And you're trying to echo the array as a string.
You may convert it to JSON:
var value = '{{ json_encode($sliderImageDataArray) }}';
If it's a Laravel collection or a model:
var value = '{{ $sliderImageData->toJson() }}';
Post a Comment for "Htmlspecialchars() Expects Parameter 1 To Be String, Array Given In Laravel"