laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Support for casts AsEnumCollection

Open Braunson opened this issue 1 month ago • 1 comments

Summary

Here's my example casts method 'preferences':

protected function casts(): array
    {
        return [
            'preferences' => AsEnumCollection::of(UserPreferences::class),
        ];
    }
}

Currently the IDE helper generates the property as AsEnumCollection. If I attempt to use $user->preferences->anyCollectionMethod() it returns an undefined method error.

Instead the IDE helper should at the minimum generate returning an Eloquent Collection instance.

 * @property \Illuminate\Database\Eloquent\Collection $preferences

Braunson avatar May 31 '24 18:05 Braunson