- What is escapework/laramedias used for?
- Laramedias is a Laravel package for attaching and managing media files on Eloquent models. It wraps league/glide to provide on-the-fly image transformations, upload handling, filesystem wiring, and URL helpers. It is intended for conventional Laravel applications that want media management inside the app rather than through a managed image CDN.
- How do I install escapework/laramedias in a Laravel project?
- Install it with Composer using composer require escapework/laramedias, then publish the package config and migrations. Configure the source disk for originals and the cache or destination disk for transformed derivatives in config/filesystems.php. You will also need to add the media model or trait to your domain and make sure the package routes are registered.
- Which Laravel and PHP versions does laramedias support?
- The package appears to be an older thin wrapper around Glide, typically associated with the Laravel 5.x to 6.x era. Laravel 9, 10, and 11 compatibility is unlikely without a fork or code changes. Check its composer.json constraints and test it against your target PHP and Laravel versions before adopting it.
- Does laramedias support polymorphic media associations on Eloquent models?
- Yes, the package provides polymorphic media associations so a media record can belong to different Eloquent models. This lets you attach images or files to multiple domain entities without duplicating media tables. You should still review the model and migration assumptions to confirm they match your application's schema conventions.
- Can laramedias generate resized image URLs with Glide?
- Yes, laramedias uses Glide to generate URLs for transformed images, such as resized or cropped versions. The package handles the route that serves the transformed output from a configured source filesystem and caches derivatives on a destination disk. Most transformation behavior is inherited from Glide, so Glide's parameter model and caching semantics apply.
- Does laramedias support S3 or remote filesystem disks?
- The package is built around configured source and destination filesystems, but Glide traditionally reads local paths directly. Remote disks such as S3 may require additional wiring or a local cache path for transformations to work reliably. Verify this against your storage setup before relying on it in production.
- Is escapework/laramedias maintained and safe for production?
- The package has very low adoption and maintenance signals, so you should treat it as effectively unmaintained. That means no guaranteed Laravel version updates, security patches, or coordinated disclosure path. For production, review the source, fork or vendor it internally, and plan to own the code.
- How does laramedias handle cache invalidation when an image is replaced?
- Glide caches derivative images by path and transformation parameters, and the wrapper may not automatically invalidate those derivatives when an original is replaced. The classic failure mode is serving stale resized images after an upload overwrites the source file. Confirm whether the package exposes any invalidation mechanism beyond manually clearing the cache disk.
- Are the Glide image transformation routes public or can I secure them?
- The package exposes HTTP routes that serve transformed images, and path traversal protections largely come from Glide itself. Routing, parameter whitelisting, signing, and authorization are the wrapper's responsibility and should be reviewed carefully. Because the package appears unmaintained, add your own access controls or signed URLs if the route is not intentionally public.
- What are alternatives to laramedias for media management in Laravel?
- Common alternatives include spatie/laravel-medialibrary for Eloquent media associations, intervention/image for direct image manipulation, or using Glide directly without a Laravel wrapper. For large-scale or edge-delivered transformations, managed services such as Cloudinary, Imgix, or Cloudflare Images may be a better fit. Choose based on whether you need in-app media records, runtime resizing, or build-time asset variants.