isGuest()) { return collect(); } $query = $this->permissions->restrictEntityRelationQuery( View::query(), 'views', 'viewable_id', 'viewable_type' ) ->orderBy('views.updated_at', 'desc') ->where('user_id', '=', user()->id); $views = $query ->skip(($page - 1) * $count) ->take($count) ->get(); $this->listLoader->loadIntoRelations($views->all(), 'viewable', false); return $views->pluck('viewable')->filter(); } }