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

[Bug]: Laravel 11.17.0 added HasCollection trait and new $collectionClass property #1035

Closed
dmason30 opened this issue Jul 25, 2024 · 3 comments

Comments

@dmason30
Copy link

dmason30 commented Jul 25, 2024

Bug description

See these PRs the HasCollection trait and $collectionClass property was added so we can properly type hint the model collection for static-analysis (e.g. PHPStan).

laravel/framework#52171
laravel/framework#52186

So now we have this on a Model:

class Post extends Model
{
    /** @use HasCollection<PostCollection<array-key, static>> */
    use HasCollection;

    protected static string $collectionClass = PostCollection::class;
}

Plugin version

8.2.2.241

Operating system

MacOS

Steps to reproduce

Use the code above and the plugin when running Generate Helper Code does not pickup the custom collections.

Relevant log output

No response

@adelf
Copy link
Member

adelf commented Jul 25, 2024

Well, marking this as a "bug" is a bit... early)

I'll try to use this declarations.

@dmason30
Copy link
Author

Sorry if I chose the wrong type. Just didn't feel right as a feature request either.

Thanks for looking into it 👍

@adelf
Copy link
Member

adelf commented Aug 11, 2024

Implemented in the Laravel Idea 8.2.3

@adelf adelf closed this as completed Aug 11, 2024
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