You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class CommonModel extends Model
{
public function scopeConnection($query, $connectionName): CommonModel
{
$this->setConnection($connectionName);
return $this;
}
}
A Model that extends this CommonModel
class MyModel extends CommonModel
{
protected $table = 'mymodel';
}
The generated PHP docs look like; @method static \Illuminate\Database\Eloquent\Builder|CommonModel connection($connectionName)
Changing this line to return MyModel will give my IDE the ability to use the scope as needed and still retain the correct properties. @method static \Illuminate\Database\Eloquent\Builder|MyModel connection($connectionName)
The text was updated successfully, but these errors were encountered:
The ModelHooks in #945 look great.
I'm hoping support for Methods could be also added. (or maybe I'm generating these PHP docs wrong, I'm not sure)
I've added a PR #1198 to support my use case.
My use case is;
A CommonModel with some general scope(s) defined
A Model that extends this CommonModel
The generated PHP docs look like;
@method static \Illuminate\Database\Eloquent\Builder|CommonModel connection($connectionName)
Changing this line to return MyModel will give my IDE the ability to use the scope as needed and still retain the correct properties.
@method static \Illuminate\Database\Eloquent\Builder|MyModel connection($connectionName)
The text was updated successfully, but these errors were encountered: