Laravel-ide-helper: Target class [Illuminate\Database\Eloquent\Factory] does not exist

Created on 17 Oct 2020  ยท  3Comments  ยท  Source: barryvdh/laravel-ide-helper

Versions:

  • ide-helper Version: 2.8.1
  • Laravel Version: 8.10.0
  • PHP Version: 7.4.3

Description:

There is an exception for ide-helper:generate command in a fresh installed laravel project :

   Illuminate\Contracts\Container\BindingResolutionException 

  Target class [Illuminate\Database\Eloquent\Factory] does not exist.

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:811
    807โ–• 
    808โ–•         try {
    809โ–•             $reflector = new ReflectionClass($concrete);
    810โ–•         } catch (ReflectionException $e) {
  โžœ 811โ–•             throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
    812โ–•         }
    813โ–• 
    814โ–•         // If the type is not instantiable, the developer is attempting to resolve
    815โ–•         // an abstract type such as an Interface or Abstract Class and there is

      +25 vendor frames 
  26  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

Steps To Reproduce:

  • Change include_factory_builders option to true
  • Run php artisan ide-helper:generate
bug

Most helpful comment

Per #1047, #1074, and the readme, include_factory_builders is deprecated for Laravel 8.0+. The fix (for now) is to set it to false and wait for #1074 to be completed and merged ๐Ÿ‘๐Ÿป

All 3 comments

Per #1047, #1074, and the readme, include_factory_builders is deprecated for Laravel 8.0+. The fix (for now) is to set it to false and wait for #1074 to be completed and merged ๐Ÿ‘๐Ÿป

https://github.com/barryvdh/laravel-ide-helper/pull/1074 was merged and the fix will be part of the next release (no ETA)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ttomdewit picture ttomdewit  ยท  5Comments

beniaminorossini picture beniaminorossini  ยท  5Comments

Newbie012 picture Newbie012  ยท  4Comments

4n70w4 picture 4n70w4  ยท  3Comments

Alymosul picture Alymosul  ยท  4Comments