Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: array_merge(): Argument #2 is not an array error

Tags:

Exceptions started to appear in all views, and when I try to run composer update, it always ends up with

{"error":{"type":"ErrorException","message":"array_merge(): Argument #2 is not an array","file":"\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":188}} 
like image 990
Deepak Thomas Avatar asked Aug 29 '14 19:08

Deepak Thomas


2 Answers

After a lot of searching and exploring each file in the 'app' folder, it appears that one file was corrupt

Delete app/storage/meta/services.json and re-run composer update and this should solve it.

like image 60
Deepak Thomas Avatar answered Sep 22 '22 16:09

Deepak Thomas


Sometimes only deleting app/storage/meta/services.json and run composer update doesn't solve the ERROR: array_merge(): Argument #2 is not an array error. At least in my case, it didn't.

Most of the time it happens when you're screwing up the bootstrap/cache/services.json file. And running composer update will not generate services.json file.

To generate the services.json file, you need to delete the previous bootstrap/cache/services.json file and run php artisan serve. Then it'll generate a fresh services.json` file.

Hope it helps to someone!

like image 35
Tahsin Abrar Avatar answered Sep 18 '22 16:09

Tahsin Abrar