I have a condition inside the relationship, where if the user is logged in, he will return the relationship, and if I do not want him to return an empty relation. here is what i want:
public function dummy() { return (auth()->user()) ? $this->hasOne(blah::class) : emptyrelationship(); }
source share