- What is knplabs/media-exposer used for?
- It is a framework-agnostic PHP library that maps media objects to public URLs through pluggable exposers. It lets application code resolve images, video, and other assets from local storage or custom backends without hardcoding file paths. It is not a media management platform, upload pipeline, transformation layer, or Laravel package.
- Is knplabs/media-exposer compatible with Laravel?
- No, it has no Laravel service provider, facade, configuration convention, Eloquent integration, or queue and storage integration. It is a narrow PHP path-resolution library, not a Laravel package. You can only use it behind custom application code, and that adds risk because the repository is archived.
- Can I install knplabs/media-exposer with Composer in a Laravel project?
- Composer installation may be technically possible only if the package's PHP and dependency constraints remain compatible with your Laravel version. Because the project is archived and targets PHP 5.3-era code, conflicts with modern Laravel, Flysystem 3, or Symfony components are likely. Verify composer.json and run a time-boxed spike before adding it to a real application.
- Is knplabs/media-exposer still maintained?
- No, the project is explicitly marked as no longer maintained by KnpLabs and the repository is archived. Archived status means no security fixes, PHP compatibility updates, or dependency maintenance. The package has very low adoption, with 14 stars and zero dependents noted in the assessment.
- What are the best Laravel alternatives to MediaExposer?
- Laravel's native Storage API, Flysystem integration, Storage::url(), and temporary URLs cover most media URL and file-resolution needs. For image processing, use maintained packages such as Intervention Image rather than a path-resolution library. A small internal MediaPathResolver contract is usually better than adopting an archived dependency.
- Does MediaExposer handle authorization or signed URLs?
- No, it focuses on exposing media through a consistent interface and mapping media objects to public URLs. The assessment warns that authorization, signed URLs, and visibility rules are enforced outside the library. If you need private media, use Laravel's temporary URLs and application-level authorization instead.
- How do I migrate from knplabs/media-exposer to Laravel Storage?
- Inventory every current resolver and map each provider to a Laravel-native or custom implementation. Define an application-owned contract such as MediaPathResolver, bind the package behind that contract, and run old and new resolvers in parallel for parity testing. Cut over behind a feature flag, monitor resolution failures, then remove the package.
- Is knplabs/media-exposer safe to use in production?
- The technical risk is high because archived code becomes internally owned code with no upstream security or compatibility fixes. Low adoption also means edge cases are likely undocumented. If it is already present in a legacy app, isolate it behind an application interface and plan replacement rather than expanding its use.
- Does knplabs/media-exposer support PHP 8 and modern Laravel versions?
- Support is not guaranteed; the library was written for PHP 5.3 and the repository is archived. You must verify PHP 8.1, 8.2, and 8.3 compatibility, Laravel version constraints, and Composer dependency conflicts yourself. The assessment recommends a compatibility matrix and dependency report before any adoption.
- Should I use MediaExposer for a new Laravel project?
- No, do not adopt it for greenfield Laravel builds. Laravel's Storage, Flysystem, CDN URL generation, and signed temporary URLs cover most needs with less operational risk. Only consider it as a legacy compatibility concern when non-trivial media-resolution rules are already encoded in the library.