ide-helper:models can generate methods and properties for "public" scopes and attributes, but not protected one.
Here is the example model:
class User extends Model
{
public function scopeBoy() { ... }
protected function scopeGirl() { ... }
public function getMidNameAttribute() { ... }
protected function getLastNameAttribute() { ... }
}
ide-helper:models only generate "public" scope and attribute:
/**
* Class User
* @property-read string midName
* @method static User boy()
*/
class User { }
Why would you like to have non-public methods/attributes added to autocompletion? You cannot access them from the outside, except in child classes (protected methods/attributes), so having that added to the docblock is pointless.
Model's scope and attribute-related functions can't be called directly. If they are declared as public, IDE tools will auto-complete these functions. Declaring as 'protected' will prevent this but also work for laravel.
Model's scope and attribute-related functions can't be called directly.
Um, why? Besides, local scopes must be declared as public.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
Not sure if it's required, but that is how it's done in the docs. I guess this is an edge-case.
https://laravel.com/docs/7.x/eloquent#local-scopes