Skip to content

Commit 1fa77f2

Browse files
authored
Merge pull request #215 from plank/5.0.0
5.0.0
2 parents c52785a + e48561b commit 1fa77f2

File tree

134 files changed

+3980
-20685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+3980
-20685
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ coverage/
55
.idea/
66
.phpunit.result.cache
77
infection/
8+
docs/build/

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 5.0.0 - 2020-10-14
4+
- 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.
5+
- 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.
6+
- 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.
7+
- Added `Media::stream()` method to easily retrieve a PSR-7 compatible Stream.
8+
- Added support for generating temporary URLs for files hosted on Amazon S3 buckets.
9+
10+
## 4.4.2 - 2020-09-26
11+
- Fixed a handful of bugs related to using a custom table name when using a custom media class
12+
13+
## 4.4.1 - 2020-09-14
14+
- Fixed Morph relation when subclassing Media (Thanks @GeoSot!)
15+
316
## 4.4.0 - 2020-09-09
417
- Added support for Laravel 8.0
518
- Dropping support for Laravel versions < 6.0

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Laravel-Mediable is a package for easily uploading and attaching media files to
1010

1111
## Features
1212

13-
- Filesystem-driven approach is easily configurable to allow any number of upload directories with different accessibility.
14-
- 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.
15-
- Attach media to models with tags, to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.
16-
- Easily query media and restrict uploads by MIME type, extension and/or aggregate type (e.g. `image` for jpeg, png or gif).
13+
- 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).
14+
- 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.
15+
- Attach media to models with tags, in order to set and retrieve media for specific purposes, such as `'thumbnail'`, `'featured image'`, `'gallery'` or `'download'`.
16+
- Integrated support for integration/image for manipulating image files to create variants for different use cases.
1717

1818
## Example Usage
1919

UPGRADING.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# Upgrading
22

3+
## 4.x to 5.x
4+
5+
* 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.
6+
* 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.
7+
* `Plank\Mediable\MediaUploaderFacade` moved to `Plank\Mediable\Facades\MediaUploader`
8+
* 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.
9+
* The following methods now include an extra `$withVariants` parameter :
10+
* `Mediable::scopeWithMedia()`
11+
* `Mediable::scopeWithMediaMatchAll()`
12+
* `Mediable::loadMedia()`
13+
* `Mediable::loadMediaMatchAll()`
14+
* `MediableCollection::loadMedia()`
15+
* `MediableCollection::loadMediaMatchAll()`
16+
317
## 3.x to 4.x
418

519
* 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.
620
* Highly recommended to explicitly specify the `'url'` config value on all disks used to generate URLs.
7-
* No longer reading the `'prefix'` config of local disks. Value should be included in the `'url'` config instead.
21+
* No longer reading the `'prefix'` config of local disks. Value should be included in the `'url'` config instead.
822

923
## 2.x to 3.x
1024

1125
* Minimum PHP version moved to 7.2
1226
* Minimum Laravel version moved to 5.6
13-
* 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.
27+
* 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.
1428

1529
## 1.x to 2.x
1630

composer.json

+14-8
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,31 @@
1616
"illuminate/filesystem": ">6.0",
1717
"illuminate/database": ">6.0",
1818
"league/flysystem": "^1.0.23",
19-
"psr/http-message": "^1.0"
19+
"psr/http-message": "^1.0",
20+
"intervention/image": "^2.5",
21+
"guzzlehttp/guzzle": "^6.5|^7.1"
2022
},
2123
"require-dev": {
22-
"orchestra/testbench": "^3.3|^4.0|^5.0|^6.0",
24+
"orchestra/testbench": "^4.0|^5.0|^6.0",
2325
"phpunit/phpunit": "^8.2.4|^9.0",
24-
"vlucas/phpdotenv": "^3.3|^4.0|^5.0",
26+
"vlucas/phpdotenv": "^4.0|^5.0",
2527
"league/flysystem-aws-s3-v3" : "^1.0.23",
26-
"guzzlehttp/guzzle": "^6.3",
2728
"guzzlehttp/promises": "^1.3",
28-
"aws/aws-sdk-php": "^3.128.1",
29+
"aws/aws-sdk-php": "^3.128.0",
2930
"php-coveralls/php-coveralls": "^2.1",
30-
"laravel/legacy-factories": "^1.0.4"
31+
"laravel/legacy-factories": "^1.0.4",
32+
"doctrine/dbal": "^2.11"
3133
},
3234
"autoload": {
3335
"psr-4": {
3436
"Plank\\Mediable\\": "src/"
3537
}
3638
},
3739
"autoload-dev":{
38-
"classmap": ["tests/", "migrations/"]
40+
"psr-4": {
41+
"Plank\\Mediable\\Tests\\": "tests/"
42+
},
43+
"classmap": ["migrations/"]
3944
},
4045
"minimum-stability": "stable",
4146
"prefer-stable": true,
@@ -45,7 +50,8 @@
4550
"Plank\\Mediable\\MediableServiceProvider"
4651
],
4752
"aliases": {
48-
"MediaUploader": "Plank\\Mediable\\MediaUploaderFacade"
53+
"MediaUploader": "Plank\\Mediable\\Facades\\MediaUploader",
54+
"ImageManipulator": "Plank\\Mediable\\Facades\\ImageManipulator"
4955
}
5056
}
5157
}

docs/build/doctrees/commands.doctree

-4.23 KB
Binary file not shown.
-27 KB
Binary file not shown.
-19.8 KB
Binary file not shown.

docs/build/doctrees/index.doctree

-9.6 KB
Binary file not shown.
-5.57 KB
Binary file not shown.

docs/build/doctrees/media.doctree

-13 KB
Binary file not shown.

docs/build/doctrees/mediable.doctree

-44.4 KB
Binary file not shown.

docs/build/doctrees/types.doctree

-5.12 KB
Binary file not shown.

docs/build/doctrees/uploader.doctree

-26.5 KB
Binary file not shown.

docs/build/html/.buildinfo

-4
This file was deleted.

docs/build/html/_sources/commands.txt

-25
This file was deleted.

0 commit comments

Comments
 (0)