LogManager::debug() must be of the type array in laravel

Viewed 1570

when I trying to add/edit my product in a laravel project admin panel I give this error Argument 2 passed to Illuminate\Log\LogManager::debug() must be of the type array, object given, called in C:\xampp\htdocs\test\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 261 but the action add/edit works correctly which means the code is correct but I don't know where this error comes from and how can I fix it.

1 Answers

Welcome to stackoverflow, barnabas!

Most of the laravel logger functions uses the same patterns, first argument is the tag, and the second one is an array of objects.

Here is the solution for you:

LogManager::debug("YOURTAG",[$yourObject]);
Related