$this->id, 'name' => $this->name, 'original_name' => $this->original_name, 'download_url' => url("/api/files/{$this->id}"), 'mime_type' => $this->mime_type, 'size' => $this->size, 'fileable_id' => $this->fileable_id, 'fileable_type' => $this->fileable_type, 'user_id' => $this->user_id, 'user' => new UserResource($this->whenLoaded('user')), 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]; } }