File uploads & platform
Brew accepts file inputs through wire:model when the component implements WithFileUploads. Uploads go to a signed temporary endpoint (or an S3-compatible pre-signed PUT), then land on the component as TemporaryUploadedFile values you can store, preview, or validate.
Quick start
Section titled “Quick start”class AvatarForm : Component(), WithFileUploads { var photo: TemporaryUploadedFile? = null
fun save() { photo?.store("avatars") }
override fun template() = """ <form wire:submit="save"> <input type="file" wire:model="photo" /> <button type="submit">Save</button> </form> """.trimIndent()}public class AvatarForm extends Component implements WithFileUploads { public TemporaryUploadedFile photo;
public void save() { if (photo != null) photo.store("avatars"); }
@Override public String template() { return """ <form wire:submit="save"> <input type="file" wire:model="photo" /> <button type="submit">Save</button> </form> """; }}Client helpers: $wire.$upload, $uploadMultiple, $cancelUpload, $removeUpload. Progress events: brew-upload-start|finish|error|cancel|progress (and livewire-upload-* aliases).
Config
Section titled “Config”| Key | Role |
|---|---|
brew.temporary_file_upload.timeout |
Signed URL lifetime (seconds) |
brew.temporary_file_upload.cleanup |
Delete temp files older than N seconds |
brew.temporary_file_upload.rules |
Global rules (file|max:12288) |
brew.temporary_file_upload.disk |
local (default) or s3 |
brew.temporary_file_upload.s3_endpoint |
Base URL for S3-compatible PUTs |
brew.csp_safe |
Serve brew.csp.min.js |
BrewManager.cleanupOldUploads() removes stale temp files. Tests can use UploadedFileFake.create(...).
Styles, JS modules, sort & intersect
Section titled “Styles, JS modules, sort & intersect”- Scoped / global CSS and CSS modules via
SupportStyles(effects.styles) - Component JS modules via
SupportJsModules(effects.scripts) - Multi-file resources under
brew/<name>.{js,css,global.css} wire:sort/wire:sort:itemandwire:intersect(.once,.half,.full, …)
Authorize & platform
Section titled “Authorize & platform”@Authorize("update", "post")fun save() { /* … */ }
authorize("update", post)Also included in this slice: locale memo, release tokens, persistent / update middleware, Cadence model synthesizers, and checksum debug messages when app.debug is on.