Skip to content

New Laravel attributes are not correctly recognized when method is protected #1378

@bbprojectnet

Description

@bbprojectnet

Versions:

  • ide-helper Version: 2.12.3
  • Laravel Version: 9.29.0
  • PHP Version: 8.1

Description:

Only public and type casted get/set methods attributes are detected.

But, according to https://laravel.com/docs/9.x/eloquent-mutators mutator method should be protected.

Also, it would be nice if ide helper supported the generic attribute declaration, like that:

	/**
	 * Name attribute.
	 *
	 * @return \Illuminate\Database\Eloquent\Casts\Attribute<string, never>
	 */
	protected function name(): Attribute
	{
		return Attribute::make(
			get: fn () => 'foo',
		);
	}

if the get/set methods do not have a return type specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions