Skip to content

Write to models bugs when class attribute is present #1734

@dansan92

Description

@dansan92

Versions:

  • ide-helper Version: 3.6.0
  • Laravel Version: 12.21.0
  • PHP Version: 8.4.5

Description:

If you have a class attribute, for example ObservedBy (Laravel Observers):

#[ObservedBy([ImageObserver::class])]
final class Image extends Model { ... }

Then running php artisan ide-helper:models -RW adds the PHPDoc between the class and the attribute, causing it to not work with PHPStan/Larastan.

For example:

#[ObservedBy([ImageObserver::class])]
/**
 * @property string $name
 * @property string $slug
 */
final class Image extends Model

I don't know if this is a bug with IDE Helper, or with Larastan, but it just doesn't work together.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions