6
0
Fork 0

article hasRead

base
panliang 2023-02-16 17:07:52 +08:00
parent c5e46383ab
commit bd7ad825f8
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class ArticleResource extends JsonResource
'like_status' => $this->whenLoaded('likesInfo', function () {
return $this->likesInfo->count() > 0;
}, false),
'has_read' => $this->hasRead($request->user()),
'has_read' => $request->user() ? $this->hasRead($request->user()) : false,
'media_type'=> $this->media_type,
'media_content'=> json_decode($this->media_content, true),
'created_at' => $this->created_at->toDateTimeString(),