Fixed tests
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
philipp lang 2024-04-15 16:37:36 +02:00
parent 55d253aa7b
commit c62f8ec676
2 changed files with 16 additions and 12 deletions

View File

@ -5,6 +5,7 @@ namespace App\Form\Resources;
use App\Form\Models\Form;
use App\Form\Models\Participant;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Collection;
/**
* @mixin Participant
@ -31,19 +32,20 @@ class ParticipantResource extends JsonResource
*/
public static function meta(Form $form): array
{
return [
'form_meta' => $form->meta,
'links' => [
'update_form_meta' => route('form.update-meta', ['form' => $form]),
],
'columns' => $form->getFields()
/** @var Collection<int, array<string, mixed>> */
$fieldData = $form->getFields()
->map(fn ($field) => [
'name' => $field->name,
'base_type' => class_basename($field),
'id' => $field->key,
'display_attribute' => $field->getDisplayAttribute(),
])
->push([
]);
return [
'form_meta' => $form->meta,
'links' => [
'update_form_meta' => route('form.update-meta', ['form' => $form]),
],
'columns' => $fieldData->push([
'name' => 'Registriert am',
'id' => 'created_at',
'display_attribute' => 'created_at_display'

View File

@ -22,6 +22,8 @@ use App\Form\Enums\SpecialType;
* @method self forMembers(bool $forMembers)
* @method self specialType(SpecialType $specialType)
* @method self hint(string $hint)
* @method self min(int $min)
* @method self max(int $max)
*/
class FormtemplateFieldRequest extends RequestFactory
{