Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mimemap Laravel Package

fileeye/mimemap

A PHP library for mapping MIME types to file extensions and back, using Apache and custom MIME data. Useful for file type detection, extension lookup, and consistent MIME handling in PHP or Laravel projects.

View on GitHub
Deep Wiki
Context7

A PHP library to handle MIME Content-Type fields and their related file extensions.

Frequently asked questions about Mimemap
What does fileeye/mimemap do?
fileeye/mimemap is a standalone PHP library that maps MIME Content-Type values to file extensions and back again. It builds its mapping table from Apache mime.types data plus any custom mappings you supply, so you get a predictable, data-driven lookup instead of relying purely on content sniffing. It is a plain Composer/PSR-4 utility with no framework coupling, so it works the same inside or outside Laravel.
Does fileeye/mimemap have a Laravel service provider or facade?
No. The package is a stateless PHP utility library with no service provider, facade, config file or framework bindings. That is deliberate: it behaves like a pure function over a data table, with no request-time I/O beyond loading its mapping files. In Laravel you bind it yourself behind an internal interface such as MimeResolver rather than calling it directly from controllers or models.
How do I install fileeye/mimemap in a Laravel project?
Install it with Composer, for example composer require fileeye/mimemap, and let PSR-4 autoloading handle the rest. There is nothing to publish and no artisan command to run, so the only setup work is pointing the resolver at your custom mapping file if you use one. Before committing, check the PHP version constraint in the package's composer.json for conflicts with your runtime matrix and existing transitive dependencies.
How is fileeye/mimemap different from symfony/mime, league/mime-type-detection and ext-fileinfo?
Laravel already ships symfony/mime for mail attachments and league/mime-type-detection via Flysystem, which backs Storage::mimeType(), plus ext-fileinfo/libmagic for content sniffing. mimemap is not a sniffing engine; it is a curated mapping table, and its marginal value is high-fidelity parity with Apache and nginx mime.types, dependable reverse lookup, and user-supplied custom overlays. Adopt it when you need consistent headers and extension mapping rather than another detector.
Can fileeye/mimemap look up file extensions from a MIME type and the reverse?
Yes, both directions are supported: MIME type to extension list, and extension to MIME type. Reverse lookup is the capability that most existing Laravel MIME facilities handle poorly, which is why the package is useful for naming downloads and building Content-Disposition headers. Because a MIME type can legitimately own several extensions, design your resolver contract to return a list and define an explicit fallback for misses or ambiguous results.
How do I add custom MIME mappings for niche formats like CAD, geospatial or legacy Office files?
Custom mappings are supplied as a YAML overlay on top of the Apache-derived data, which is the package's strongest argument over libmagic. Use it for long-tail formats where content sniffing returns application/octet-stream and your download headers end up wrong. Decide who owns the custom map file and what review process applies to additions, since every change alters runtime behavior. Commit the map to version control and treat edits like code changes.
What license does fileeye/mimemap use and can I ship it in a commercial Laravel application?
The package is LGPL-3.0, which is copyleft. SaaS usage without distributing the code is generally fine, but if you ship an on-premises or otherwise distributed Laravel application, the dynamic-linking argument for PHP is legally unsettled and needs counsel sign-off. Every MIT-licensed alternative sidesteps this issue entirely, so confirm your distribution model before adopting it.
Which PHP versions and extensions does fileeye/mimemap require?
The library targets modern PHP and is installable via Composer, but you should verify the exact PHP constraint in its composer.json against your runtime matrix before adopting. The practical compatibility question is the YAML mapping layer: check whether it uses a pure-PHP parser or pulls ext-yaml, an extension you may not run in production. Also review transitive dependencies for conflicts with what Laravel already requires.
How should I integrate fileeye/mimemap into a Laravel application?
Use an adapter, never a big-bang swap. Define an internal MimeResolver contract with mimeForExtension(), extensionsForMime() and mimeForFile(), ship a default FrameworkMimeResolver built on league/mime-type-detection plus symfony/mime, and add a MimeMapResolver implementation bound behind a config toggle or feature flag. Migrate call sites in risk order, starting with download headers and other low-blast-radius paths. Keep the library in the infrastructure layer so controllers and models stay unaware of it.
Is fileeye/mimemap actively maintained, and how risky is adopting it?
Treat it as a vendor-risk item: it is a small, single-maintainer project with modest adoption and no commercial backing or visible SLA. There is also a metadata anomaly in the published release date, so check actual commit cadence and PHP support in the repository rather than trusting the last-release field. Plan an internal fork or replacement path up front, and note that mapping data updates are behavior changes that warrant regression tests on your Content-Type headers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource