Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for casts AsEnumCollection #1553

Open
Braunson opened this issue May 31, 2024 · 1 comment
Open

Support for casts AsEnumCollection #1553

Braunson opened this issue May 31, 2024 · 1 comment

Comments

@Braunson
Copy link
Contributor

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
@mfn
Copy link
Collaborator

mfn commented Jun 1, 2024

Can you make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants