12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Http\Resources\API;
- use Illuminate\Http\Request;
- class BimFileResource extends BaseResource
- {
- /**
- * Transform the resource into an array.
- *
- * @return array<string, mixed>
- */
- public function toArray(Request $request): array
- {
- $extraArr = json_decode_arr($this->extra);
- return [
- 'id' => $this->id,
- 'file_id' => $this->file_id,
- 'bim_file_id' => $this->bim_file_id,
- 'convert_status' => $this->convert_status,
- 'lightweight_size' => $extraArr['achievementFileSize'] ?? 0,
- 'data_version' => $extraArr['dataVersion'] ?? '',
- 'software_type' => $extraArr['softwareType'] ?? ($extraArr['fileOwnership'] ?? ''),
- // 'file_title' => $this->file->title,
- // 'file_size' => $this->file->size,
- // 'file_created_at' => (string) $this->file->created_at,
- ];
- }
- }
|