- Filename and pathname sanitization will use the app locale when transliterating UTF-8 characters to ascii.
- Restored original behaviour of treating unrecognized mime types as
application/octet-stream
(changed in recent version of Flysystem)
- Fixed S3 temporary URL generation for Laravel 9+ / Flysystem 3+
- Added support for Laravel 9
- Dropped support for PHP 7.3
- Dropped support for Laravel 6.x and 7.x
- Fixed S3 temporary URL generation not respecting disk root configuration.
- Support specifying file visibility on variant creation
- Fix aggregate type matching not properly handling case mismatches of mime types and/or extensions
- Handle Guzzle stream_for()` deprecation
- Allow passing filesystem options via uploader and mover
- Fixed Facade PHPDOC typehints
- Added
MediaUploader::onDuplicateReplaceWithVariants()
which behaves similar toonDuplicateReplace()
but will also delete any variants of the replaced Media record. - Fixed
onDuplicateUpdate()
failing if file exists but without a matching model.
- Fixed
MediaUploader
Facade returning the same instance
- Resolve bugs with PHP 8.0
ImageManipulator
now uses$media->contents()
instead of$media->stream()
, as Intervention Image loads the whole file into memory anyways, and the former seems to have fewer hiccups for various cloud filesystems.
- Fixed serialization of
CreateImageVariants
job.
- Fixed docblock of
attachMedia()
andSyncMedia()
(Thanks @hailwood!)
- Fixed additional bugs with the
MediableCollection::delete()
method - Optimized the execution speed of
MediableCollection::delete()
- fixed notices generated from collection offset access in
MediableCollection::delete()
- Added support for creating image variants using the intervention/image library. Variants can be created synchronously in the current process or asychronously as queued jobs. Media records keep track of variants created from them.
- Fixed Laravel 8+ migration squashing. Database migrations are now loaded from within the package instead of copied to the application's database/migration directory. See UPGRADING.md for steps to avoid conflicts.
- Directory and filename validation now only allows URL and filesystem safe ASCII characters (alphanumeric plus
.
,-
,_
, and/
for directories). Will automatically attempt to transliterate UTF-8 accented characters and ligatures into their ASCII equivalent, all other characters will be converted to hyphens. - Added
Media::stream()
method to easily retrieve a PSR-7 compatible Stream. - Added support for generating temporary URLs for files hosted on Amazon S3 buckets.
- Fixed a handful of bugs related to using a custom table name when using a custom media class
- Fixed Morph relation when subclassing Media (Thanks @GeoSot!)
- Added support for Laravel 8.0
- Dropping support for Laravel versions < 6.0
- Dropping support for PHP versions 7.2
- Fix composer version constraint of
league/flysystem
to allow minor version bumps - Removed redundant index from the Media table database migration
Media::moveToDisk()
andMedia::copyToDisk()
now correctly transfer file visibility to the new disk.
- Added
Media::moveToDisk()
andMedia::copyToDisk()
methods.
- The
Media::$size
property is now cast as int, fixing a TypeError. (Thanks @boumanb!) - Fixed
RemoteUrlAdapter
,StreamAdapter
, andStreamResourceAdapter
potentially returning an incorrect filename and/or extension if the query params of the URL contains certain characters.
- Fix bug with package auto-discovery with PHP 7.4
- Fix issue caused by a bug with doctrine/inflector 1.4.0
- Replaced usage of the
getClientSize()
method deprecated in Symphony 4.1 withgetSize()
- Added support for Laravel 7.0
- Fixed the timing of the beforeSave callback. Now occurs before onDuplicate validation occurs. This allows the callback to be used to determine where to place the file
- The beforeSave callback is now called triggered by the
MediaUploader::replace()
andMediaUploader::import()
methods as well
- Added support for the new Symfony MimeTypes class in favor of the deprecated ExtensionGuesser (Thanks @crishoj!)
- changed UrlGenerators to use the underlying filesystemAdapter's
url()
method - UrlGenerators no longer throw
MediaUrlException
when the file does not have public visibility. This removes the need to read IO for files local disks or to make HTTP calls for files on s3 disks. - Removed
LocalUrlGenerator::getPublicPath()
- No longer reading the
'prefix'
config of local disks. Value should be included in the'url'
config instead.
- Fixed public visibility not being respected when generating URLs for local files that are not in the webroot.
- Updated minimum support requirements to PHP 7.2 and Laravel 5.6+.
- Added PHP 7 parameter and return type hints across the board
- Added a new method
getStreamResource
toSourceAdapterInterface
, uploader will now attempt to use a stream to reduce memory usage. - Added
delete()
method toMediableCollection
for mass deleting media records and files. - Added support for file visibility on a file-by-file basis.
- Cleaned up test suite.
- fixed a number of docblocks
- The name of the Mediables pivot table is now configurable (Thanks @nadinengland!)
- Fix windows paths pattern (Thanks @aalyusuf!)
- Add methods to facade for IDE autocompletion (Thanks @simonschaufi!)
- Added update on duplicate behaviour to MediaUploader (Thanks @pet1330!)
- Fixed remote URL data source raising an error when headers cannot be read (Thanks @sebdesign!)
- Return correct types in source adapter methods (Thanks @sebdesign!)
- Add docblocks for Media properties and query scopes (Thanks @sebdesign!)
- Fixed docblocks (Thanks @sebdesign!)
- Fixed tags with numeric values
- Added
MediaUploader::verifyFile()
to apply validation to a source without uploading (Thanks @JulesPrimo) - Added
MediaUploader::beforeSave()
to allow editing custom fields on Media records before they are saved (Thanks @JulesPrimo)
- Fix URL generation for local disks using symbolic links in different Laravel versions (Thanks @sebdesign !)
MediaUploader::onDuplicateIncrement()
behaviour adjusted to use hyphens instead of parenthesis (Thanks @ryankilf!)
- Added
Media::copyTo()
method (Thanks @johannesschobel!)
- Added
Mediable::lastMedia()
convenience method (Thanks @pet1330!)
- Added Laravel 5.5 package autodiscovery
- Fixed bugs due to method renamed in Laravel 5.5
- Added missing use statements.
- Fixed composer notation use.
- Added fallback extension guesser to various SourceAdapters for cases where file path does not include extension (e.g. tmp files).
- Fixed allowed extension checking failing due to case mismatch
- Restored Laravel 5.2 compatibility
S3UrlGenerator
now generates the url directly with S3 client, instead of with theFilesystemAdapter::url()
method, which was only added in Laravel 5.2.15- Added fallback for
wherePivotIn()
used in eager loading, which was only added in Laravel 5.3
- Fixed issues cause by Laravel 5.4 backwards-compatibility breaks
- Increased laravel minumum version to 5.3, which is the minimum that works with the current implementation. Will attempt to restore support for older versions in an upcoming release.
- The
onDuplicateDelete
action of theMediaUploader
now manually deletes theMedia
record and the file on disk, instead of depending on the record existing to clean its own file.
- Added support for raw content strings to
MediaUploader
(Thanks @sebdesign) - Added support for stream resources to
MediaUploader
(Thanks @sebdesign) - Added support for PSR-7 StreamInterface objects to
MediaUploader
(Thanks @sebdesign) - All SourceAdapters now properly adhere to the described interface.
- Refactored test suite for speed.
- Separated MediaUploadException into a number of subclasses for more granular exception handling (Thanks @sebdesign!).
- Added HandlesMediaUploadExceptions trait for converting MediaUploadExceptions into HttpException with appropriate error codes (Thanks @sebdesign).
- Fixed SQL escaping issue in
Mediable::getOrderValueForTags
.
- Fixed
Media::scopeForPathOnDisk
not working when path does not contain a directory (Thanks @geidelguerra!).
- Fixed typo in
MediaUploader
'sOnDuplicateError
behaviour (Thanks @geidelguerra!).
- Added handling for symlinked local disks.
- fixed minor issue where variable could be undefined.
- Added means of removing order by from media relation query.
- Fixed multiple media passed to
attachMedia()
orsyncMedia()
receiving the same order value. - Fixed issue with ONLY_FULL_GROUP_BY (MySQL 5.6.5+).
- Reworked
attachMedia()
to optimize the number of executed queries.
Mediable
models now remember the order in whichMedia
is attached to each tag.- Renamed a few
MediaUploader
methods. - Facilitated setting
MediaUploader
on-duplicate behaviour. Thanks @jdhmtl. MediaUploader
can now generate filenames using hash of file contents (Thanks @geidelguerra!).- Added
import()
andupdate()
methods toMediaUploader
.
- Published migration file now uses dynamic timestamp (Thanks @borisdamevin!).
- Added behaviour for detaching mediable relationships when Media or Mediable models are deleted or soft deleted.
- Fixed
Mediable
relationship not connecting to customMedia
subclass defined in config.
- Added match-all case to media eager load helpers.
Mediable::getTagsForMedia()
now properly rehydrates media if necessary.Mediable::load()
now looks for media that is either the $relationship key or value.
- Added MediaCollection class.
- Added media eager loading helpers to query builder,
Mediable
, and MediaCollection.
- Added object typehints to all appropriate functions and closures.