Closed
Description
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
Labels
No labels