laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Models extends the wrong class

Open clementbirkle opened this issue 1 year ago • 1 comments

Versions:

  • ide-helper Version: 2.13.0
  • Laravel Version: 10
  • PHP Version: 8.1

Description:

All models in file _ide_helper_models.php extends always \Eloquent.

Sometimes it's wrong because a model can extends another model before to extends the final parent. Because of that, VS Code auto completion is sometimes wrong or doesn't works with parent classes.

Example

abstract class ModelA extends \Illuminate\Database\Eloquent\Model
{
}

class ModelB extends ModelA
{
}

Will generate:

namespace App\Models{
	class ModelB extends \Eloquent {}
}

clementbirkle avatar Aug 21 '23 15:08 clementbirkle

Workaround is to write the phpdoc to the model class directly.

mfn avatar Feb 16 '24 22:02 mfn