*/ public function toArray(Request $request): array { $locale = app()->getLocale(); return [ 'id' => $this->id, 'locale' => $locale, ...TranslatablePayload::resolve( $this->resource, ['title', 'slug', 'description', 'what_you_get'], $locale, ), 'status' => $this->status->value, // The numbers that let someone decide in ten seconds. Time is the // scarce resource here, not money. 'hours_per_week' => $this->hours_per_week, 'duration_weeks' => $this->duration_weeks, 'total_hours' => $this->totalHours(), 'seniority' => $this->seniority, 'closes_at' => $this->closes_at?->toDateString(), 'project' => PublicProjectResource::make($this->whenLoaded('project')), 'technologies' => PublicTechnologyResource::collection($this->whenLoaded('technologies')), 'alternates' => SiteUrls::alternates($this->resource, 'call'), 'path' => SiteUrls::alternates($this->resource, 'call')[$locale] ?? null, ]; } }