Download the PHP package optimistdigital/nova-media-field without Composer
On this page you can find all versions of the php package optimistdigital/nova-media-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download optimistdigital/nova-media-field
More information about optimistdigital/nova-media-field
Files in optimistdigital/nova-media-field
Package nova-media-field
Short Description Laravel Nova field for image/gallery upload and library browsing.
License MIT
Informations about the package nova-media-field
NB! Nova Media Field is now deprecated in the favour of Nova Media Hub
No further updates will be provided!
Nova Media Field
This Laravel Nova package adds a simple media upload field with a media browser to Laravel Nova.
Requirements
- Imagick
- Laravel Nova >= 2.10.0
Features:
- Handles any type of file
- Media browser
- Drag-and-drop multi file upload
- Multiple file selection
- Drag and drop reordering of selected files
- Collections
- Thumbnail generator with custom sizes (also re-generation via command)
- WebP generator (also re-generation via command)
- Works with nova-translatable
Upgrading to v2
Check CHANGELOG.MD
Installation
Install the package in a Laravel Nova project via Composer and run migrations:
And then register the NovaMediaLibrary
tool in NovaServiceProvider
:
Usage
Image thumbnails
Image thumbnails define different conversions for uploaded images. These conversions can be configured
under media field config file under image_sizes
key.
crop
- Default:false
, whentrue
then image might be cropped if not fit for defined ratio. Requires width and height to be defined.width
- Width to resize the imageheight
- Height to resize the image
Defining only one dimension (width or height) keeps the ratio.
Video thumbnails
Media field can generate thumbnails from the first frame of the video. It uses ffmpeg
and php-ffmpeg
to achieve this.
To enable this, you must:
- Install
ffmpeg
- Provide paths to
ffmpeg
andffprobe
(on some environments)
If ffmpeg
and ffprobe
paths are not automatically detected, add these variables to your ENV.
WebP support
By default WebP support is enabled in nova media config file. On image upload the WebP will be generated automatically for you. If you have activated or plan to activate it later then you can use commands below to regenerate missing thumbnails and WebP files.
Regenerate thumbnails
To regenerate thumbnails (after defining a new thumbnail size etc) run this command:
Regenerate WebP files
To regenerate your missing WebP files run this command:
Collections
Collections are basically upload groups that can have their own set of upload rules.
Collection configuration goes under media field config file under collection
key.
label
- Display label for collectionconstraints
- Array of validation rules (like in Request validation)image_sizes
- Sizes to generate (overrides default)
Handle duplicate uploads
If resolve_duplicates
is set to true then md5 hash of first mb of the original uploaded
file will be generated and used to check if any file duplicates are discovered. If there is
then it will serve existing media item without saving the new one.
Customizing
This package allows overriding of core logic for any custom needs project may have
Credits
License
Nova Media Field is open-sourced software licensed under the MIT license.
All versions of nova-media-field with dependencies
intervention/image Version ^2.7.1
laravel/nova Version ^3.0
php-ffmpeg/php-ffmpeg Version ^1.0.1
guzzlehttp/guzzle Version ^7.0.0