xantios/mimey
xantios/mimey is a PHP MIME type helper for converting file extensions to MIME types and back. It offers a lightweight API for detection and validation, simplifying file upload and content-type handling in Laravel or plain PHP apps.
symfony/mime which Laravel already pulls in, or write ~40 lines of our own?" Because the scope is so narrow, the honest framing is: buy only if it saves more review time than it costs in supply-chain and maintenance risk.Content-Type on downloads, API file responses, and outbound mail attachments affects whether browsers preview vs. download files and whether third-party systems (CRMs, ERPs, email clients) accept our payloads. This is a small but real source of support tickets..dwg, .heic, .glb, .epub, internal export formats, vendor-specific data interchange formats), runtime registration of custom MIME types is the one genuinely differentiating capability here.finfo/fileinfo, getimagesize, AV scanning, allow-lists), and this package is at best a cheap pre-filter. Do not let it become the answer to a compliance or abuse question.Reasonable fit when:
Content-Type hints, demo/seed data generation, filename-based type guesses for display icons, dev tooling.Look elsewhere when:
symfony/mime is already installed — and in a Laravel app it almost certainly is. That component is battle-tested, actively maintained, and gives you MimeTypes::getDefault(), getExtensions(), and registration. Choosing this package means carrying a second, less-maintained implementation of the same data.finfo_file() / mime_content_type() for anything user-supplied. Extension guessing must not be the gate.Recommendation to weigh in the room: default to symfony/mime (already on the dependency tree, zero new risk). Adopt xantios/mimey only if the custom-registration ergonomics are materially nicer for your use case and you're comfortable pinning to a version you may have to fork.
For executives (30 seconds). This is a very small, free, MIT-licensed utility that turns file extensions into MIME types and back. It would save an engineer a few hours inside a file-handling feature we've already planned — it is not a feature, not a differentiator, and not on the roadmap. The trade-off is supply-chain risk: 33 GitHub stars, one release in 2021, no verified support for current PHP/Laravel versions. My recommendation is to use the equivalent component that already ships with Laravel rather than add a new dependency. If we do adopt it, the realistic cost is low and the worst case is that we fork and maintain ~40 lines ourselves — a bounded, unexciting downside, not a strategic risk. Either way, it does not change scope, timeline, or budget.
For engineering leads. Narrow API, PSR-4, no dependencies, optional service provider and facade — integration is under an hour, and migration away is under a day. Two caveats to accept explicitly: (1) it's unmaintained since 2021 and we should pin the version and vendor it if adopted; (2) extension-based MIME resolution must never be the security boundary for user uploads — pair it with finfo-based content validation and an allow-list. Given symfony/mime is already in the tree, the default engineering answer should be "reuse what we have"; the exception is if runtime registration of proprietary extensions is a real requirement, in which case this package's ergonomics justify the dependency and the small fork risk is acceptable.
How can I help you explore Laravel packages today?