Skip to content

Query on embedsMany not working properly #744

Closed
@behzadsh

Description

@behzadsh

Let say I have model like this

class Author extends Moloquent
{
    public function books()
    {
        return $this->embedsMany(Book::class);
    }
}

And i want to query books of an Author

$author = Author::find($authorId);
$author->books()->where('pages', '>', 300)->get();

By running the code above I get this error

Missing argument 1 for Illuminate\\Support\\Collection::get()

if I pass column array to get method, I get:

array_key_exists(): The first argument should be either a string or an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions