You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The following example will provide you with a better understanding of the packag
25
25
26
26
We will create a YouTube-like service, with a model named `Channel`. This `Channel` will have two types of media: `avatar` and `videos`. We will define these media types in the `registerMediaCollections` method.
27
27
28
-
We want to store the avatars in a square format, with dimensions not exceeding 500px, and in the WebP format. We will accomplish this in the `registerMediaTransformations` method.
28
+
We want to store the avatars in a square format, with dimensions not exceeding 500px, and in the WebP format. We will accomplish this in the `transform` parameter.
29
29
30
30
For each media type, we will need a set of conversions, as illustrated in the following tree:
31
31
@@ -42,7 +42,7 @@ For each media type, we will need a set of conversions, as illustrated in the fo
42
42
/hls
43
43
```
44
44
45
-
We will define these conversions in the `registerMediaConversions` method.
45
+
We will define these conversions in the `conversions` parameter.
46
46
47
47
Here is how our `Channel` class will be defined:
48
48
@@ -124,7 +124,7 @@ class ChannelAvatarController extends Controller
124
124
function function store(Request $request, Channel $channel)
There are two essential concepts to understand, both of which are associated with the Model and its media:
262
262
263
-
-**Media Collection**: This defines a group of media with its specific settings (the group can only contain one media item). For example, avatar, thumbnail, and upload are all media collections.
263
+
-**Media Collection**: This defines a group of media with its specific settings (the group can only contain one or more media). For example, avatar, thumbnail, and upload are all media collections.
264
264
265
265
-**Media Conversion**: This defines a file conversion of a particular media item. For instance, a 720p version of a larger 1440p video, a WebP or PNG conversion of an image, are all examples of media conversions. Notably, a media conversion can also have its own media conversions.
266
266
@@ -325,11 +325,12 @@ class Channel extends Model implements InteractWithMedia
325
325
326
326
#### Registering Media Conversions
327
327
328
-
This package provides common jobs for your conversions to simplify your work:
328
+
This package provides common converions to simplify your work:
329
329
330
-
-`MediaConversionImage`: This job optimizes, resizes, or converts any image using `spatie/image`.
331
-
-`MediaConversionVideo`: This job optimizes, resizes, or converts any video using `pbmedia/laravel-ffmpeg`.
332
-
-`MediaConversionPoster`: This job extracts a poster using `pbmedia/laravel-ffmpeg`.
330
+
-`MediaConversionImage`: This conversion optimizes, resizes, or converts any image using `spatie/image`.
331
+
-`MediaConversionVideo`: This conversion optimizes, resizes, or converts any video using `pbmedia/laravel-ffmpeg`.
332
+
-`MediaConversionAudio`: This conversion optimizes, resizes, converts or extract any audio using `pbmedia/laravel-ffmpeg`.
333
+
-`MediaConversionPoster`: This conversion extracts a poster using `pbmedia/laravel-ffmpeg`.
333
334
334
335
```php
335
336
namespace App\Models;
@@ -393,6 +394,9 @@ class Channel extends Model implements InteractWithMedia
0 commit comments