Files
InvoiceShelf/app/Domains/Metadata/Http/Resources/CustomFieldResource.php
T
Darko Gjorgjijoski 5ef7804e60 refactor: adopt modular domain architecture (#747)
* refactor: stabilize model identities for domain migration

* refactor: extract module platform context

* refactor: assign models to domain contexts

* refactor: extract ai platform context

* refactor: extract storage platform context

* refactor: extract mail platform context

* refactor: extract pdf platform context

* refactor: extract operations platform context

* refactor: move installation into operations platform

* refactor: extract money domain context

* refactor: extract taxation domain context

* refactor: extract catalog domain context

* refactor: extract metadata domain context

* refactor: extract reporting domain context

* refactor: extract purchases domain context

* refactor: extract receivables domain context

* refactor: extract accounts domain context

* refactor: complete reporting statement boundary

* refactor: extract contacts domain context

* refactor: extract sales domain context

* refactor: remove legacy application layers

* fix: migrate legacy bouncer role identities
2026-08-05 17:40:03 +02:00

44 lines
1.4 KiB
PHP

<?php
namespace App\Domains\Metadata\Http\Resources;
use App\Domains\Accounts\Http\Resources\CompanyResource;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CustomFieldResource extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param Request $request
*/
public function toArray($request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'label' => $this->label,
'model_type' => $this->model_type,
'type' => $this->type,
'placeholder' => $this->placeholder,
'options' => $this->options,
'boolean_answer' => $this->boolean_answer,
'date_answer' => $this->date_answer,
'time_answer' => $this->time_answer,
'string_answer' => $this->string_answer,
'number_answer' => $this->number_answer,
'date_time_answer' => $this->date_time_answer,
'is_required' => $this->is_required,
'in_use' => $this->in_use,
'order' => $this->order,
'company_id' => $this->company_id,
'default_answer' => $this->default_answer,
'company' => $this->when($this->company()->exists(), function () {
return new CompanyResource($this->company);
}),
];
}
}