Skip to content

No search for existance of a relation is available #50

@drmheydari

Description

@drmheydari

Some of users of model Student have foreign key to model User. I create relation student() in model User with hasOne() to join them. Now in model User I need to filter those who are student. How can I do that?

I tried
public $searchable = ['name', 'mobile', 'email', 'id', 'student:id'];

and in string query I set

student:id=(null)

and doesn't work because the relation doesn't exist in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions