The class log does not exist in F: \ xampp \ htdocs \ news5.2.23 \ vendor \ laravel \ framework \ src \ Illuminate \ Container \ Container.php: 738 Stack Trace:

advertisements

I ran config:cache in my Laravel 5.2 application and this error started showing up.

Fatal error: Uncaught ReflectionException: Class log does not exist in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php:738 Stack trace: #0 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(738): ReflectionClass->__construct('log') #1 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(633): Illuminate\Container\Container->build('log', Array) #2 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697): Illuminate\Container\Container->make('log', Array) #3 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(853): Illuminate\Foundation\Application->make('log') #4 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(808): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(7 in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 738

I looked for many solutions. Nothing worked for me.

  • My .env file does not have any spaces
  • I deleted extra packages from my composer.json and ran composer update.
  • I ran php artisan clear compiled many times.
  • I looked for errors in my files but could not find any.
  • I also enabled the mysql extension since I found it somewhere. Then I did a fresh checkout of Laravel 5.2 and now the error is like this.

So, it's not a problem of any config file of mine. Its something else. Any of you have any idea?


Ok , so I solved it. Looks liek I had multiple issues.

  • In my fresh check out of laravel 5.2, where I was finding error about not having vendor/autoload.php file, I ran in the root directory in command window,

'composer update --no-scripts' , then 'composer update'. That solved the issue.

  • I also had to enable my mysql extension by editing php.ini file.
  • Finally, in my existing project, I actually found a problem in config/app.php. I missed a ',' somewhere. And people, laravel is a disgusting debugger. I miss my cakephp more.

It's a laravel 5 issue. Better to use laravel 4 still