feat: ship creator journey v2 and profile updates

This commit is contained in:
2026-04-12 21:42:07 +02:00
parent a2457f4e49
commit d5cff21ea2
335 changed files with 20147 additions and 1545 deletions

View File

@@ -17,6 +17,27 @@ class Category extends Model
protected $casts = ['is_active' => 'boolean'];
public function getNameAttribute(?string $value): ?string
{
return self::decodeHtmlEntities($value);
}
public function setNameAttribute(?string $value): void
{
$normalized = self::decodeHtmlEntities($value);
$this->attributes['name'] = $normalized !== null ? trim($normalized) : null;
}
public function getDescriptionAttribute(?string $value): ?string
{
return self::decodeHtmlEntities($value);
}
public function setDescriptionAttribute(?string $value): void
{
$this->attributes['description'] = self::decodeHtmlEntities($value);
}
/**
* Ensure slug is always lowercase and valid before saving.
*/
@@ -159,4 +180,25 @@ class Category extends Model
return $category;
}
private static function decodeHtmlEntities(?string $value): ?string
{
if ($value === null) {
return null;
}
$decoded = $value;
for ($index = 0; $index < 5; $index++) {
$next = html_entity_decode($decoded, ENT_QUOTES | ENT_HTML5, 'UTF-8');
if ($next === $decoded) {
break;
}
$decoded = $next;
}
return $decoded;
}
}