laravel-logger, Invalid argument supplied for foreach() Articles

laravel-logger, Invalid argument supplied for foreach()

by | May 13, 2019 | Laravel | 0 comments

jeremykenedy/laravel-logger, Invalid argument supplied for foreach()


protected function shouldLog($request)
foreach (config(‘LaravelLogger.loggerMiddlewareExcept’) as $except) {
if ($except !== ‘/’) {
$except = trim($except, ‘/’);

if ($request->is($except)) {
return false;

return true;

As soon i try to update laravel-logger library it start to show this error. main problem is the in .env file. 

.env file is missing a configuration called  LARAVEL_LOGGER_MIDDLEWARE_EXCEPT

I added this line on .env file but no luck, logging stopped. What i did, actually i wen to the file where the problem occurred and commented those line with foreach. This is not a proper solution and ideally a bad practice, but no way. After commenting this it started to logg again. 

If you find any solution or authority do any update please let me know. 



Submit a Comment

Your email address will not be published. Required fields are marked *

Name Goes Here

Name Goes Here


Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.