Skip to content

Commit

Permalink
Merge pull request #215 from plank/5.0.0
Browse files Browse the repository at this point in the history
5.0.0
  • Loading branch information
frasmage committed Oct 15, 2020
2 parents c52785a + e48561b commit 1fa77f2
Show file tree
Hide file tree
Showing 134 changed files with 3,980 additions and 20,685 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ coverage/
.idea/
.phpunit.result.cache
infection/
docs/build/
13 changes: 13 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog

## 5.0.0 - 2020-10-14
- 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.

## 4.4.2 - 2020-09-26
- Fixed a handful of bugs related to using a custom table name when using a custom media class

## 4.4.1 - 2020-09-14
- Fixed Morph relation when subclassing Media (Thanks @GeoSot!)

## 4.4.0 - 2020-09-09
- Added support for Laravel 8.0
- Dropping support for Laravel versions < 6.0
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -10,10 +10,10 @@ Laravel-Mediable is a package for easily uploading and attaching media files to

## Features

- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility.
- Many-to-many polymorphic relationships allow any number of media to be assigned to any number of other models without any need to modify the schema.
- Attach media to models with tags, to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.
- Easily query media and restrict uploads by MIME type, extension and/or aggregate type (e.g. `image` for jpeg, png or gif).
- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility. Easily restrict uploads by MIME type, extension and/or aggregate type (e.g. `image` for JPEG, PNG or GIF).
- Many-to-many polymorphic relationships allow any number of media to be assigned to any number of other models without any need to modify their schema.
- Attach media to models with tags, in order to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.
- Integrated support for integration/image for manipulating image files to create variants for different use cases.

## Example Usage

Expand Down
18 changes: 16 additions & 2 deletions UPGRADING.md
@@ -1,16 +1,30 @@
# Upgrading

## 4.x to 5.x

* Database migration files are now served from within the package. In your migrations table, rename the `XXXX_XX_XX_XXXXXX_create_mediable_tables.php` entry to `2016_06_27_000000_create_mediable_tables.php` and delete your local copy of the migration file from the /database/migrations directory. If any customizations were made to the tables, those should be defined as one or more separate ALTER table migrations.
* Two columns added to the `media` table: `variant_name` (varchar) and `original_media_id` (should match `media.id` column type). Migration file is included with the package.
* `Plank\Mediable\MediaUploaderFacade` moved to `Plank\Mediable\Facades\MediaUploader`
* 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.
* The following methods now include an extra `$withVariants` parameter :
* `Mediable::scopeWithMedia()`
* `Mediable::scopeWithMediaMatchAll()`
* `Mediable::loadMedia()`
* `Mediable::loadMediaMatchAll()`
* `MediableCollection::loadMedia()`
* `MediableCollection::loadMediaMatchAll()`

## 3.x to 4.x

* 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. Visibility can still checked with `$media->isPubliclyAccessible()`, if necessary.
* Highly recommended to explicitly specify the `'url'` config value on all disks used to generate URLs.
* No longer reading the `'prefix'` config of local disks. Value should be included in the `'url'` config instead.
* No longer reading the `'prefix'` config of local disks. Value should be included in the `'url'` config instead.

## 2.x to 3.x

* Minimum PHP version moved to 7.2
* Minimum Laravel version moved to 5.6
* All methods now have parameter and return type hints. If extending any class or implementing any interface from this package, method signatures will need to be updated.
* All methods now have parameter and return type hints. If extending any class or implementing any interface from this package, method signatures will need to be updated.

## 1.x to 2.x

Expand Down
22 changes: 14 additions & 8 deletions composer.json
Expand Up @@ -16,26 +16,31 @@
"illuminate/filesystem": ">6.0",
"illuminate/database": ">6.0",
"league/flysystem": "^1.0.23",
"psr/http-message": "^1.0"
"psr/http-message": "^1.0",
"intervention/image": "^2.5",
"guzzlehttp/guzzle": "^6.5|^7.1"
},
"require-dev": {
"orchestra/testbench": "^3.3|^4.0|^5.0|^6.0",
"orchestra/testbench": "^4.0|^5.0|^6.0",
"phpunit/phpunit": "^8.2.4|^9.0",
"vlucas/phpdotenv": "^3.3|^4.0|^5.0",
"vlucas/phpdotenv": "^4.0|^5.0",
"league/flysystem-aws-s3-v3" : "^1.0.23",
"guzzlehttp/guzzle": "^6.3",
"guzzlehttp/promises": "^1.3",
"aws/aws-sdk-php": "^3.128.1",
"aws/aws-sdk-php": "^3.128.0",
"php-coveralls/php-coveralls": "^2.1",
"laravel/legacy-factories": "^1.0.4"
"laravel/legacy-factories": "^1.0.4",
"doctrine/dbal": "^2.11"
},
"autoload": {
"psr-4": {
"Plank\\Mediable\\": "src/"
}
},
"autoload-dev":{
"classmap": ["tests/", "migrations/"]
"psr-4": {
"Plank\\Mediable\\Tests\\": "tests/"
},
"classmap": ["migrations/"]
},
"minimum-stability": "stable",
"prefer-stable": true,
Expand All @@ -45,7 +50,8 @@
"Plank\\Mediable\\MediableServiceProvider"
],
"aliases": {
"MediaUploader": "Plank\\Mediable\\MediaUploaderFacade"
"MediaUploader": "Plank\\Mediable\\Facades\\MediaUploader",
"ImageManipulator": "Plank\\Mediable\\Facades\\ImageManipulator"
}
}
}
Expand Down
Binary file removed docs/build/doctrees/commands.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/configuration.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file removed docs/build/doctrees/index.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/installation.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/media.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/mediable.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/types.doctree
Binary file not shown.
Binary file removed docs/build/doctrees/uploader.doctree
Binary file not shown.
4 changes: 0 additions & 4 deletions docs/build/html/.buildinfo

This file was deleted.

25 changes: 0 additions & 25 deletions docs/build/html/_sources/commands.txt

This file was deleted.

0 comments on commit 1fa77f2

Please sign in to comment.