showBillableRate = $showBillableRate; } /** * Transform the resource into an array. * * @return array */ public function toArray(Request $request): array { $currencyService = app(CurrencyService::class); return [ /** @var string $id ID */ 'id' => $this->resource->id, /** @var string $name Name */ 'name' => $this->resource->name, /** @var bool $color Personal organizations automatically created after registration */ 'is_personal' => $this->resource->personal_team, /** @var int|null $billable_rate Billable rate in cents per hour */ 'billable_rate' => $this->showBillableRate ? $this->resource->billable_rate : null, /** @var bool $employees_can_see_billable_rates Can members of the organization with role "employee" see the billable rates */ 'employees_can_see_billable_rates' => $this->resource->employees_can_see_billable_rates, /** @var bool $employees_can_manage_tasks Can members of the organization with role "employee" manage tasks in public projects and projects they are assigned to */ 'employees_can_manage_tasks' => $this->resource->employees_can_manage_tasks, /** @var bool $prevent_overlapping_time_entries Prevent creating overlapping time entries (only new entries) */ 'prevent_overlapping_time_entries' => $this->resource->prevent_overlapping_time_entries, /** @var bool $breaks_enabled Whether members of the organization can track breaks */ 'breaks_enabled' => $this->resource->breaks_enabled, /** @var string $currency Currency code (ISO 4217) */ 'currency' => $this->resource->currency, /** @var string $currency_symbol Currency symbol */ 'currency_symbol' => $currencyService->getCurrencySymbol($this->resource->currency), /** @var NumberFormat $number_format Number format */ 'number_format' => $this->resource->number_format->value, /** @var CurrencyFormat $currency_format Currency format */ 'currency_format' => $this->resource->currency_format->value, /** @var DateFormat $date_format Date format */ 'date_format' => $this->resource->date_format->value, /** @var IntervalFormat $interval_format Interval format */ 'interval_format' => $this->resource->interval_format->value, /** @var TimeFormat $time_format Time format */ 'time_format' => $this->resource->time_format->value, ]; } }