This is the documentation for
v4 but the latest version is
v11
.
You can switch versions in the menu on the left/at the top.
Check your current version with the following command:
composer show spatie/laravel-medialibrary
A media conversion can be added to your model in the registerModelConversions
-function.
It should start with a call to addMediaConversion
. From there on you can use any of
the methods available in the API. They are all chainable.
Take a look in the Defining conversions section
for more details.
##General methods
##addMediaConversion
public function addMediaConversion($name)
##performOnCollections
public function performOnCollections($collectionNames)
##setManipulations
Note: you should pass an array with Glide parameters to $manipulations
.
public function setManipulations($manipulations)
##queued
public function queued()
##nonQueued
public function nonQueued()
##Glide convenience methods
##setWidth
public function setWidth($width)
##setHeight
##setFormat
public function setFormat($format)
##setFit
public function setFit($fit)
##setRectangle
public function setRectangle($width, $height, $x, $y)