protected function scopeVisibleTo(Builder $query, User $actor = null) { if ($actor !== null) { $query->whereVisibleTo($actor); } return $query; }