Defining conversions

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

/**
 * Add a conversion.
 *
 * @param string $nam
 *
 * @return \Spatie\MediaLibrary\Conversion\Conversion
 */
public function addMediaConversion($name)

performOnCollections

/**
 * Set the collection names on which this conversion must be performed.
 *
 * @param string $collectionNames,...
 *
 * @return $this
 */
public function performOnCollections($collectionNames)

queued

/**
 * Mark this conversion as one that should be queued.
 *
 * @return $this
 */
 public function queued()

nonQueued

/**
 * Mark this conversion as one that should not be queued.
 *
 * @return $this
 */
public function nonQueued()

Image manipulations

You may add any call to one of the manipulation functions available on the spatie/image package.