Files
CRM/app/ExportResources/Contact/Gift.php
Kroonk a213a1dba0
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
refactor: replace custom CRM with Monica fork
2026-05-22 16:19:55 +02:00

38 lines
785 B
PHP

<?php
namespace App\ExportResources\Contact;
use App\ExportResources\ExportResource;
class Gift extends ExportResource
{
protected $columns = [
'uuid',
'created_at',
'updated_at',
];
protected $properties = [
'name',
'comment',
'url',
'amount',
'status',
'date',
];
public function data(): ?array
{
return [
'properties' => [
$this->mergeWhen($this->recipient !== null, function () {
return ['recipient' => $this->recipient->uuid];
}),
$this->mergeWhen($this->photos->count() > 0, [
'photos' => $this->photos->mapUuid(),
]),
],
];
}
}