webseite funktioniert, pay sdk, blog backend funktioniert

This commit is contained in:
Codex Agent
2025-09-29 22:16:12 +02:00
parent e52a4005aa
commit 21c9391e2c
51 changed files with 2093 additions and 1293 deletions

View File

@@ -40,7 +40,32 @@ class Package extends Model
'features' => 'array',
];
// features handled by $casts = ['features' => 'array']
protected function features(): Attribute
{
return Attribute::make(
get: function ($value) {
if (is_array($value)) {
return $value;
}
if (is_string($value)) {
$decoded = json_decode($value, true);
if (is_string($decoded)) {
$decoded = json_decode($decoded, true);
}
if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) {
return $decoded;
}
}
return [];
},
);
}
public function eventPackages(): HasMany
{
@@ -77,4 +102,4 @@ class Package extends Model
'max_events_per_year' => $this->max_events_per_year,
];
}
}
}