When it checks for errors its checking the wrong class, this is an \Illuminate\Database\Eloquent\Model object but it misassumes it as \Illuminate\Database\Eloquent\Builder which then returns the error.

    Thank you!

    So $stockItems should be array<Model> instead?

    May I see how the $stockItems is created?

      willslade right, I'm just trying to find out, where was the $stockItems variable created, or how did it get the type wrong. I don't see any docblock on the screenshot)


        Apologies I get what your asking for now. It is a repository wrapper, when you call getModel that returns an Eloquent query instance.

          willslade I see! thanks, I'll try to repro the issue; we still have some work to do with eloquent)

            12 days later
            25 days later

            OscarJesusSilvaLavalle I would recommend the following workaround instead:

            /** @var Stage $stage */
              Write a Reply...