- $baseQuery = $this->queryPageReferencesToEntity($entity)
- ->with([
- 'from' => fn (Relation $query) => $query->select(Page::$listAttributes),
- 'from.book' => fn (Relation $query) => $query->scopes('visible'),
- 'from.chapter' => fn (Relation $query) => $query->scopes('visible'),
- ]);
-
- $references = $this->permissions->restrictEntityRelationQuery(
- $baseQuery,
- 'references',
- 'from_id',
- 'from_type'
- )->get();
+ $references = $this->queryReferencesToEntity($entity)->get();
+ $this->mixedEntityListLoader->loadIntoRelations($references->all(), 'from', true);