nvl / media
Laravel media uploads, associations, variations and localized metadata
Requires
- php: ^8.4
- ext-ctype: *
- ext-curl: *
- ext-dom: *
- ext-fileinfo: *
- ext-filter: *
- ext-libxml: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.8.2 || ^8.0
- guzzlehttp/psr7: ^2.7 || ^3.0
- laravel/framework: ^13.0
- league/flysystem: ^3.25
- nesbot/carbon: ^2.72 || ^3.0
- nvl/core: ^7.0
- nvl/translatable: ^7.0
- spatie/image: ^3.0
- symfony/http-foundation: ^7.4.19 || ^8.1.7
Requires (Dev)
- ext-gd: *
- ext-pcntl: *
- ext-phar: *
- aws/aws-sdk-php: ^3.322.9
- larastan/larastan: ^3.10
- laravel/pint: ^1.27
- league/flysystem-aws-s3-v3: ^3.0
- mockery/mockery: ^1.6
- nvl/filterable: ^7.0
- nvl/ownership: ^7.0
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- shipmonk/composer-dependency-analyser: ^1.8
- spatie/laravel-data: ^4.23
- symfony/process: ^7.0 || ^8.0
Suggests
- aws/aws-sdk-php: Built-in S3 uploads and multipart storage: composer require league/flysystem-aws-s3-v3:^3.0 aws/aws-sdk-php:^3.322.9 --with-all-dependencies.
- league/flysystem-aws-s3-v3: Built-in S3 uploads and multipart storage: composer require league/flysystem-aws-s3-v3:^3.0 aws/aws-sdk-php:^3.322.9 --with-all-dependencies.
- nvl/ownership: Adds optional model-declared ownership, isolation, adoption and captured worker contexts.
Provides
None
Conflicts
- aws/aws-sdk-php: <3.322.9 || >=4.0
- league/flysystem-aws-s3-v3: <3.0 || >=4.0
- nvl/ownership: <7.0 || >=8.0
- spatie/image-optimizer: <1.7.3
Replaces
None
README
Media provides complete services for uploads, associations, private delivery, image variations, multipart uploads, scanning and storage recovery. Requires PHP 8.4 and Laravel 13.
composer require nvl/media:^7.0 php artisan vendor:publish --tag=nvl-media-config
Laravel discovers the provider automatically. The provider publishes its full runtime defaults to config/nvl-media.php; the configuration reference explains the settings. Configure the host before accepting uploads, then run php artisan nvl:media:doctor --production --strict.
To install the packaged agent guidance in the application's .agents/skills/nvl-media directory:
php artisan vendor:publish --tag=nvl-media-skills
Review local skill changes before republishing. The skill refers to the installed package's documentation under vendor/nvl/media/docs.
Consumers own their data objects, Actions, controllers, routes, resources and frontend types. Services accept explicit actors and native models, files, enums and documented arrays. Services retain validation, authorization, ownership admission, transactions, locks and after-commit cleanup.
use Nvl\Media\Services\MediaReader; $assets = app(MediaReader::class)->paginate($actor, ['per_page' => 25, 'page' => 1]);
Bind the authorization contracts and register model slots with HasNvlMedia::registerNvlMedia() before writing media. SystemActor::Background requires an explicit policy grant. Optional Spatie Permission support does not bypass native ownership boundaries.
Configure Laravel filesystem disks, their allowlist and delivery policies, a scanner for untrusted files, and queue workers for image processing. Built-in S3 storage requires the optional SDK and adapter documented in S3; model-declared ownership requires the compatible nvl/ownership:^7.0 runtime. Unowned and local-only installations do not require either feature. Image drivers need their corresponding runtime extension/library. Services return native models and domain results; consumers shape public responses and protect private storage attributes.
Publish nvl-media-config when configuration overrides are needed. Choose exactly one migration owner: automatic package migrations with nvl-media.migrations.enabled=true, or published nvl-media-migrations with automatic loading disabled. Review existing tables before applying migrations.
Both public and private URL defaults use application delivery. Public direct/CDN URLs are an explicit per-disk choice. Private URL reads return an authenticated endpoint; issuing signed application or provider temporary links requires an authorized actor and explicit expiration. See delivery configuration.
The package registers no HTTP routes. Consumers implement authenticated management and signed delivery endpoints using the package authorization and storage services. See HTTP integration.
- PHP API
- HTTP integration
- Configuration
- Extension contracts and lifecycle events
- Image variations and queues
- S3 and object storage
- Commands
- Events
- Upgrading
- Security
- Contributing
- Changelog
The package ships its machine-readable consumer API catalog alongside these references. Use the documented native services and focused extension contracts when composing application adapters.