Tuesday, February 14, 2017

[Laravel5.4][Resolved] array_merge(): Argument #2 is not an array

(2/2) ErrorException

array_merge(): Argument #2 is not an array (View: C:\xampp\htdocs\test\resources\views\articles\show.blade.php)
in Factory.php (line 134)
at CompilerEngine->handleViewException(object(ErrorException), 1)in PhpEngine.php (line 44)
I think there maybe many reason to cause this problem, I almost can't search the solution from internet to solve this...
Finally I found this line cause the problem, where the $data is an object:
@include('modules.panel', $data)
I guess this require argument two as array format but it's an object, so i convert it to array and it works fine:
@include('modules.panel', (array) $data)

No comments :

Post a Comment