Plugins base (#613)

* wip

* wip

* cleanup

* notification channels

* phpstan

* services

* remove server types

* refactoring

* refactoring
This commit is contained in:
Saeed Vaziry
2025-06-14 14:35:18 +02:00
committed by GitHub
parent adc0653d15
commit 131b828807
311 changed files with 3976 additions and 2660 deletions

34
app/DTOs/DynamicForm.php Normal file
View File

@ -0,0 +1,34 @@
<?php
namespace App\DTOs;
readonly class DynamicForm
{
/**
* @param array<int, DynamicField> $fields
*/
public function __construct(
private array $fields = [],
) {}
/**
* @param array<int, DynamicField> $fields
*/
public static function make(array $fields): self
{
return new self($fields);
}
/**
* @return array<int, mixed>
*/
public function toArray(): array
{
$fields = [];
foreach ($this->fields as $field) {
$fields[] = $field->toArray();
}
return $fields;
}
}