-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
When generating the Eloquent Helper Code via Laravel Idea I always get warnings inside a model referencing the same models properties.
E.g.
The following code will highlight $this->name
as "Property accessed via magic method"
class User {
public function getName()
{
return $this->name;
}
}
When accessing a property from outside the models scope it works fine. E.g. accessing ->name
on role inside the User model is fine.
class User {
public function getRoleName()
{
return Role::first()->name;
}
}
Using laravel-ide-helper
with php artisan ide-helper:models -M
which generates a @mixin
DocBlock also works.
/**
* @mixin IdeHelperApplicant
*/
class User
Adding the DocBlock directly to the model also works, but is messing up the models code:
/**
* @property string $name
*/
class User
Maybe this in an issue with PhpStorm but it would be great to have a workaround (e.g. via the --write-mixin
option)