处理nl2br

main
liutk 2024-05-28 12:18:41 +08:00
parent 1968dc461e
commit 4304072d07
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ class ActivityResource extends JsonResource
'id' => $this->id,
'name' => $this->name,
'cover' => $this->cover ??'',
'rules' => $this->rules ??'',
'rules' => nl2br($this->rules ??''),
'start_at' => $this->start_at->format('Y-m-d H:i'),
'end_at' => $this->end_at->format('Y-m-d H:i'),
'state' => $this->state,

View File

@ -27,7 +27,7 @@ class UserGiftResource extends JsonResource
return $this->gift->rank;
}, ''),
'gift_explain'=> $this->whenLoaded('gift', function () {
return $this->gift->explain;
return nl2br($this->gift->explain);
}, ''),
'activity_name' => $this->whenLoaded('activity', function () {
return $this->activity->name;