deleted event param use array instead of model

This commit is contained in:
xiaomlove
2025-05-16 22:01:12 +07:00
parent 45c41047da
commit 1381390c8c
8 changed files with 47 additions and 31 deletions

View File

@@ -31,6 +31,10 @@ class Torrent extends NexusModel
'last_action' => 'datetime',
];
protected $hidden = [
'info_hash',
];
public static $commentFields = [
'id', 'name', 'added', 'visible', 'banned', 'owner', 'sp_state', 'promotion_time_type', 'promotion_until', 'pos_state',
'hr', 'picktype', 'picktime', 'last_action', 'leechers', 'seeders', 'times_completed', 'views', 'size', 'cover', 'anonymous',

View File

@@ -16,6 +16,9 @@ class TorrentExtra extends NexusModel
{
return Attribute::make(
get: function ($value) {
if (is_null($value)) {
return null;
}
$jsonDecoded = json_decode($value, true);
if (is_array($jsonDecoded)) {
return $jsonDecoded;