All notable changes to laravel-medialibrary
will be documented in this file
- drop support for PHP 7.1
- add support for Laravel 5.8
- avoid exception when getting a video frame that does not exist
- only set
custom_headers
property if explicitly set
- use absolute urls for responsive image sources
- fix sortable
- fix for issue #1277
- fix support for Lumen
- add rate limiting to clean command
- fix for determining extension for non-image filetypes
- fix a bug in clean command when no responsive images were generated
- add support for Laravel 5.7
- allow the job classes to be overridden in the config file
- make sure previews responsive images db entries get cleaned up before regenerating
- add
$copiedOriginalFile
to theConversionWillStart
event
- fix for multiple files with the same filename in one ZIP archive
- fix
markAsConversionGenerated
: disable model events when saving extra properties in Media::updated event
do not use - broken
- fix
markAsConversionGenerated
- fix
ids
option ofRegenerateCommand
- bugfix around responsive images
- add support from
webp
- fix bug where
addMediaFromUrl
would not work if the file contained a space
- proper check and tests on forced deletion with soft delete models.
- add dev dependency on pdo SQLite to prevent confusing errors.
- fix #1076
- fix custom properties not saved on copy (#1073)
- Add
hasGeneratedConversion
- avoid removing the file when the model uses
SoftDeletes
- improve checking applied traits on the Media model
- fix
ffprobe
path
- always use the correct image driver.
- ease
maennchen/zipstream-php
requirements
- Fix for renaming files when not all conversions are present
- Fix bugs when working with remote filesystems
- fix a typo in
medialibrary.disk_name
.
Filesystem
interface removed.- rename
Filesytem::renameFile(Media $media, string $oldFileName)
toFilesystem::syncFileNames(Media $media)
- The
default_filesystem
config key has been changed todisk_name
.
- fix publishing views
- fix for adding remote files with no name
- fix responsive images rendering of conversions
- add null fallback when placeholder SVG isn't rendered yet (#967)
- add ResponsiveImagesGenerated event
- support custom headers for conversions (#868)
-
added support for responsive images
-
added
MediaCollections
-
added single file collections
-
added
ZipStreamResponse
-
added
move
andcopy
methods onMedia
-
file names will be lowercased when adding them to the medialibrary
-
the names of converted images will now start with the name of the original file
-
dropped support for soft deletes
-
removed distinction between
HasMedia
andHasMediaConversions
-
dropped support for PHP 7.0
-
ffmpeg_binaries
renamed toffmpeg_path
,ffprobe_binaries
renamed toffprobe_path
- add wildcard manipulations
- add
withManipulations
toFileAdder
- add support for
root
config key for s3 disks.
- add support for L5.6
- change the directory deletion order
- use better default for s3 domain
- fix download error
- make returning media in controllers always download the associated file
- update
spatie/image
dep
- fix clearing entire media collection except a single media instance
- improve config comments
- fixed the spelling of the
getFirstTemporaryUrl
method
- add
getFirstTemporaryUrl
- add
only-missing
andonly
options to themedialibrary:regenerate
command
- fix correct minimal versions for
league/flysystem
andspatie/image
when using--prefer-lowest
option with composer
- fix deletion of files when using a custom path generator
- implement
Responsable
interface - improve sanitizing filenames
- add
sanitizingFileName
- fix for working with large files
- add
ConversionWillStart
event
- fixed URL-encoding for S3 files
- bugfix:
getTemporaryUrl
now uses disk name instead of disk driver
- bugfix: remove
getTemporaryUrl
method fromUrlGenerator
interface
- add
getTemporaryUrl
method for media stored on S3
- add compatiblity for Laravel 5.5
- dropped support for older Laravel versions
- the signature of
registerMediaConversions
has been changed - the default disk has changed from
media
topublic
defaultFilesystem
config option has been renamed todefault_filesystem
- add
getPath
toS3UrlGenerator
- fix error when try to close a file that was already closed by flysystem
- fix
MediaCannotBeDeleted
exception
- add support for soft deletes
- fixed array fields in
addMultipleMediaFromRequest
- add parameter to specify allowed mime types to
addMediaFromUrl
andaddMediaFromBase64
- fix bugs regarding attaching media to non-existing models
- add support to
addAllMediaFromRequest
for file names in the request that contain an array
- show progress bar when regenerating media
- media can now be attached to unsaved models
- fix bug where
mediaIsPreloaded
always returned true
- fix bug where the wrong extension would be returned by
getResultExtension
forkeepOriginalImageFormat
- add
clearMediaCollectionExcept
method
- add
keepOriginalImageFormat
manipulation
- add
toMediaCollection
- fix bug where streams would be used on external filesystems that do not support streaming
- prevent migration from being published multiple times
LocalUrlGenerator
will now use theurl
property ofdisk
when one has been set
- fix for using
MediaRepository
with a custom media model
- add
createMultipleFromRequest
andcreateAllFromRequest
onFileAdder
- add
temporary_directory_path
to config
- fix bug around
getRemoteHeadersForFile()
- fix for undefined function
getPath
when using S3
this version is broken, do not use
- fix for undefined function
getPath
when using S3
- add support for
registerMediaConversionsUsingModelInstance
- add
addMediaFromBase64
- add
fullUrl
method
- fix loading manipulations from the db
- fix for
getFirstMediaUrl()
always returning the url for the first conversion
- add
toMediaLibraryOnCloudDisk
- image generators may now be specified in the config file
- use json columns for
manipulations
andcustom_properties
- refactor all functions in
FileCannotBeAdded
to their own exception classes - rename config file from
laravel-medialibrary
tomedialibrary
- remove
toCollection
andtoCollectionOnDisk
andtoMediaLibraryOnDisk
- replace dependency on
spatie/laravel-glide
byspatie/image
- mime types will now be stored in the database so they can be queried even if files are stored on external filesystems
- rename
Spatie\MedialibraryFilesystemInterface
toSpatie\Medialibrary\Filesystem\Filesystem
- remove
withCustomProperties
,getNestedCustomProperty
,setNestedCustomProperty
,forgetNestedCustomProperty
andhasNestedCustomProperty
- drop support for Lumen and anything below Laravel 5.4
- clean up all classes
KNOWN BUG: loading manipulations from the db doesn't work in certain edge cases, fix incoming soon
- add
FilesystemInterface
- avoid unnecessary regeneration of conversions when saving a model
- add support for Laravel 5.4
- drop support for Laravel 5.1
- put files using
r
mode instead ofr+
- avoid creating / deleting temp dir if no conversions should be performed
- fix bug in
setNewOrder
- added
hasNestedCustomProperty
,getNestedCustomProperty
,setNestedCustomProperty
andforgetNestedCustomProperty
to use dot notation with custom properties - renamed
removeCustomProperty
toforgetCustomProperty
(removeCustomProperty
still exists but is marked as deprecated)
- fix for getting preloaded media in the wrong order
- refactored the preloading of media
- reduce amount of calls to
s3
- add
addCustomHeaders
function
- improve returned values for
getUrl
methods
- fix for image generators when using S3
- the image generators wil now do their supported extensions check in a case insensitive manner
- fixed bug where an exception would be raised when using S3
- fix bug where urls to media would not be encoded anymore
- introduced
ImageGenerators
- encode urls to media
- fix svg and pdf file path when performing conversions
- made compatible with L5.3
- fixed some files that had a wrong namespace
- added thumbnail generation for video's
- added force option to the artisan commands
- fixed the
src
format option when dealing with jpegs
- added
mime
attribute on theMedia
model
- added
removeCustomProperty
function
- added
medialibrary:clean
command - the
medialibrary:regenerate
will continue regenerating files even if a primary media file is missing
- Fix regeneration command (see #260). It'll now properly regenerate files for all passed media id's
- Add support for converting svg's
- Add Lumen compatibility
- Delete the conversion directory even when it is not underneath the media directory
- Added the
src
option for thefm
conversion parameter
- Added
shouldDeletePreservingMedia
- Fixed queued jobs in Laravel 5.1
- add support for Glide 1.0
- added
addMediaFromRequest
method - small refactors
- Only detect mimetype from file on local disks
- Fixed an issue that occured when deleting models with media in some php versions
- Fixed mistakes in the version constraints on the illuminate components
- Improved the file type detection for files without an extension
- Added support for
morphMap
- Improved the compatiblity with packages that hook into the
delete
method of an Eloquent model
- The
regenerate
-command now accepts anids
-option
- Added
medialibrary:clear
command
- Make migrations compatible with mysql's strict mode
- Added a
deletePreservingMedia
-function that will delete the model but not remove the associated files
- Use
config_path
helper in ServiceProvider to allow easier integration in Lumen
- Recognize gifs as images
- Removed support for laravel-glide v3
- Added missing
InvalidNewOrder
-exception
Important node: there is a bug in this version that prevents the creation of derived files
- Add support for laravel-glide v3
- Add configurable headers when uploading media to a remote disk
- use database_path when publishing migrations
- Fixed the processing a file name with special characters
- Remove adding .gitignore files
- Accept Symfony\Component\HttpFoundation\File\File-object when adding files
- Fixed mime-type errors when using the local filesystem
- Fixed the event names to make them more readable
CollectionHasBeenCleared
,ConversionHasBeenCompleted
,MediaHasBeenAdded
- Added
CollectionClearedEvent
,ConversionCompleteEvent
,MediaAddedEvent
- Fixed an issue where a model would not regenerate manipulations after changing manipulations on media
- Fix bug when using a custom UrlGenerator class
- Added PathGenerator
This version contains a bug when using a custom UrlGenerator, please upgrade to 3.9.1
- Added ability to add media from a url
$media = $this->testModel->addMediaFromUrl($url)
clearMediaCollection
is now chainable
- Add mimetype when putting a file on a disk.
- Fix generation of local url's on non-unix hosts
- Added
setCustomProperty
-method on Media
- Added
withProperties
andwithAttributes
methods
- Bugfix:
HasMediaTrait::updateMedia
now also updates custom properties. It also updates the order column starting at 1 instead of 0 (behaves the same as the sortable trait)
- Added the ability to provide a default value fallback to the
getCustomProperty
method
- Added support for using a custom model
- Fixed a bug where conversions would always be performed on the default queue
- Added
hasCustomProperty
- andgetCustomProperty
-convenience-methods
- Allow 0 for
x
andy
parameters insetRectangle
- Removed dependency on spatie/eloquent-sortable
- Add index to morphable fields in migration which could improve performance.
- Remove unnecessary query when adding a file
- Fixes tests
- Add index to morphable fields in migration which could improve performance. NOTE: if you started out using this version, the tests will be broken. You should make sure model_id and model_type are nullable in your database.
- Added functions to get a path to a file in the media library
- Avoid creating empty conversions-directories
- Fixed a bug where chaining the conversion convenience methods would not give the right result
- Fixed a bug where getByModelType would return null
- Images and pdf with capitalized extensions will now be recognized
- Fixed: a rare issue where binding the command would fail
- Added: methods to rename the media object and file name before adding a file to the collection
- Fixed:
updateMedia
now returns updated media
- Replaced
addMedia
by a fluent interface - Added the ability to store custom properties on a media object
- Added support for multi-filesystem libraries
getMedia
will now return all media regardless of collectionhasMedia
will count all media regardless of collection- Uploads can now be processed directly when importing a file
- Renamed various classes to better reflect their functionality
- Added: hasMedia convenience method
- Fixed: when renaming file_name on a media object the orginal file gets renamed as well
- Fixed: use FQCN for facades instead of using the aliases
- Fixed an issue where too much queries were executed
- Added
hasMediaWithoutConversions
-interface
- Fixes a bug where a valid UrlGenerator would not be recognized
- Fixes a bug where an exception would be thrown when adding a pdf on systems without Imagick installed
- Fixes some bugs where files would not be removed when deleting a media-object
- Require correct version of spatie/string
- Bugfix: correct typehint in HasMediaTrait
- Added some convenience methods for some frequent used manipulations
- fix bug in regenerate command
This version is a complete rewrite. Though there are lots of breaking changes most features of v1 are retained. Notable new functions:
- filesystem abstraction: associated files can be stored on any filesystem Laravel 5's filesystem allows. So you could for instance store everything on S3.
- thumbnails can now be generated for pdf files
- registering conversions has been made more intuïtive
- it's now very easy to add custom logic to generate urls
- images can be manipulated per media object
- Bugfix: prevent migration from being published multiple times
- Small bugfixes
- Added:
Spatie\MediaLibrary\Models\Media::getHumanReadableFileSize()
- Bugfix: make compatible with Laravel 5.1
- Bugfix: Renamed the boot method of MedialibraryModeltrait so it plays nice with the boot method of other traits and the base model.
- Feature: The
profile
parameter inMedia::getUrl()
andMediaLibraryModelTrait::getUrl()
is now optional. On null, it retrieves the original file's url. - Bugfix:
Media::getOriginalUrl()
now returns the correct url.
- Bugfix: Removed unnecessary static methods from
MediaLibraryModelInterface
- Added a method to remove all media in a collection.
- Fixed a bug where not all image profiles would be processed
- Added
getImageProfileProperties()
to interface
- Create the medialibrary directory if it does not exist
- Files without extensions are now allowed
- Added check to make sure the file that must be added to the medialibrary exists
- Added option to specify the name of the queue that should be used to create image manipulations
- initial release