laravel-webhook-client icon indicating copy to clipboard operation
laravel-webhook-client copied to clipboard

Missing payload attachments fix

Open ryangalea7 opened this issue 5 months ago • 0 comments

Problem

Laravel does not include file attachments in $request->input(), which caused the webhook client to miss uploaded files when building the payload. As a result, attachments were silently dropped and could not be accessed later.

Solution

This PR explicitly extracts uploaded files from $request->allFiles(), encodes their content, and appends them to the payload. The getAttachments() method then reconstructs these files into UploadedFile instances using temporary files.

Changes

  • Files are extracted, base64-encoded, and added under the attachments key in the payload.
  • New getAttachments() method reads from the payload and rebuilds the files.

Notes

  • The attachment data is tested and works alongside the other regular payload information.
  • This has not been tested for backwards compatibility, so do consider testing this if it's a requirement.

ryangalea7 avatar May 29 '25 15:05 ryangalea7