laravel-webhook-client
laravel-webhook-client copied to clipboard
Missing payload attachments fix
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
attachmentskey 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.