'https://instagram.com/handle'], nullable: true), new OA\Property(property: 'created_at', type: 'string', format: 'date-time'), ] )] /** @mixin User */ class UserResource extends JsonResource { /** * @return array */ public function toArray(Request $request): array { return [ 'id' => $this->id, 'name' => $this->name, 'username' => $this->username, 'email' => $this->email, 'mobile' => $this->mobile, 'avatar_url' => $this->avatar_path ? Storage::disk('public')->url($this->avatar_path) : null, 'is_public' => $this->is_public, 'social_links' => $this->social_links ?: null, 'created_at' => $this->created_at?->toIso8601String(), ]; } }