user()); return [ 'id' => $this->id, 'content' => $this->content, 'type' => $this->type, 'visibility' => $this->visibility, 'is_pinned' => (bool) $this->is_pinned, 'author' => $this->whenLoaded('user', fn () => $this->user?->only(['id', 'name'])), 'edited_at' => $this->edited_at?->toISOString(), 'created_at' => $this->created_at?->toISOString(), 'updated_at' => $this->updated_at?->toISOString(), 'capabilities' => [ 'edit' => $gate->allows('update', $this->resource), 'delete' => $gate->allows('delete', $this->resource), 'pin' => $gate->allows('pin', $this->resource), ], ]; } }