Spatie\MediaLibrary\Conversion\Conversion::setFit PHP Method

setFit() public method

Matches with Glide's 'fit'-parameter.
public setFit ( string $fit )
$fit string
    public function setFit(string $fit)
    {
        $validFits = ['contain', 'max', 'fill', 'stretch', 'crop', 'crop-top-left', 'crop-top', 'crop-top-right', 'crop-left', 'crop-center', 'crop-right', 'crop-bottom-left', 'crop-bottom', 'crop-bottom-right'];
        if (!in_array($fit, $validFits)) {
            throw InvalidConversionParameter::invalidFit($fit, $validFits);
        }
        $this->setManipulationParameter('fit', $fit);
        return $this;
    }