변환된 이력 컬렉션 배열 */ public function toArray(Request $request): array { return [ 'data' => $this->collection->map(function ($history) { return (new ScheduleHistoryResource($history))->toListArray(); }), 'pagination' => $this->when($this->resource instanceof LengthAwarePaginator, [ 'current_page' => $this->resource->currentPage(), 'last_page' => $this->resource->lastPage(), 'per_page' => $this->resource->perPage(), 'total' => $this->resource->total(), 'from' => $this->resource->firstItem(), 'to' => $this->resource->lastItem(), 'has_more_pages' => $this->resource->hasMorePages(), ]), ]; } }