🆙 More fixes 🆙

This commit is contained in:
Remco
2026-01-19 20:56:16 +01:00
parent 4a359a4fc9
commit f2ba190a47
7 changed files with 32 additions and 8 deletions
@@ -15,16 +15,25 @@ class WebsiteHelpCenterTicket extends Model
public $timestamps = false;
/**
* @return BelongsTo<User, $this>
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
/**
* @return BelongsTo<WebsiteHelpCenterCategory, $this>
*/
public function category(): BelongsTo
{
return $this->belongsTo(WebsiteHelpCenterCategory::class);
}
/**
* @return HasMany<WebsiteHelpCenterTicketReply, $this>
*/
public function replies(): HasMany
{
return $this->hasMany(WebsiteHelpCenterTicketReply::class, 'ticket_id');
@@ -50,8 +59,11 @@ class WebsiteHelpCenterTicket extends Model
return $this->open || hasPermission('manage_website_tickets');
}
/**
* @return \Illuminate\Database\Eloquent\Casts\Attribute<string, never>
*/
protected function content(): \Illuminate\Database\Eloquent\Casts\Attribute
{
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn($value) => Purify::clean($value));
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn ($value) => Purify::clean((string) $value));
}
}