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.