Skip to content

Call to a member function wrap() on null #729

@blackakula

Description

@blackakula

When trying to use static method whereHas of the Model, Call to a member function wrap() on null fatal error appears.

Reason: Jenssegers\Mongodb\Query\Builder class has no grammar property set.

Call stack:

in Relation.php line 282
at FatalErrorException->__construct('message' => '???', 'code' => '???', 'severity' => '???', 'filename' => '???', 'lineno' => '???', 'traceOffset' => '???', 'traceArgs' => '???', 'trace' => '???') in HandleExceptions.php line 133
at HandleExceptions->fatalExceptionFromError('error' => '???', 'traceOffset' => '???') in HandleExceptions.php line 118
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at Relation->wrap('value' => '???') in BelongsTo.php line 94
at BelongsTo->getRelationCountQuery('query' => '???', 'parent' => '???') in Builder.php line 583
at Builder->has('relation' => '???', 'operator' => '???', 'count' => '???', 'boolean' => '???', 'callback' => '???') in Builder.php line 644
at Builder->whereHas('relation' => '???', 'callback' => '???', 'operator' => '???', 'count' => '???') in Model.php line 3459

Is there any workaround?

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