givanov95/laravel-attachments
A Laravel package for adding file attachments to Eloquent models. It offers a simple, reusable API to associate, store, retrieve, and manage uploaded files, making it easy to attach documents or images to records without repeating upload logic across your application.
Image/File into an Attachment model and AttachmentLifecycle signals active maintenance, which strengthens the case for adopting rather than building and owning this logic in-house.attachments.extra_extensions turns "should we allow SVG/JSON/XML?" into a deliberate, reviewable configuration choice rather than an accidental default..bin) is the only item needing product/UX verification.Consider adoption when:
extra_extensions deliberately.Look elsewhere when:
.bin, and enabling them via extra_extensions carries explicit XSS risk.For executives: This package lets us ship file and image attachment features faster instead of building upload handling, ordering, cleanup, and lifecycle logic ourselves. The new release closes a stored-XSS vulnerability class by default, which lowers security risk for any feature that accepts user uploads. The upgrade is low-effort: the public API is unchanged, and the internal refactor improves maintainability and reduces our long-term fork risk. The one decision we need to make is which additional file types, if any, product wants to allow; that choice now requires an explicit, security-reviewed configuration rather than happening by accident.
For engineering: v1.4.0 is a security release plus an internal consolidation. Uploads now keep their detected extension only if it is on a safe allowlist; everything else becomes .bin. Existing stored files are untouched, so we should audit current uploads and confirm nothing depends on inline SVG/XML/JSON serving. attachments.extra_extensions is available but documented as dangerous for html, svg, xml, js, php, and similar; treat any addition as a security decision. The Image/File → Attachment model refactor and shared AttachmentController / AttachmentLifecycle do not change public methods, relations, routes, or flash messages, so upgrade risk is low. Recommended actions: upgrade, run attachment tests, audit legacy uploads, and document the chosen extension policy.
How can I help you explore Laravel packages today?