classes/Models/Image.php
public function urlify($size, $multiplier = 1)
    {
        // Get fluent config
        $config = $this->getConfig();

        // Setup vars
        $size = $this->sizes[$size];
        $scale = $size[0] / $this->bench;
        $width = $height = null;

        // Figure out percentage sizes.  First one of the dimensnios is tested
        // to see if it looks a percentage.  If so, make it a percentage of one of
        // the hard coded sizes.  Otherwise, scale the dimension by comaring the
        // size to a the benchmark (laptop).
        if ($perc = $this->perc($config['width'])) {
            $width = $perc * $size[0] * $multiplier;
        } elseif ($config['width']) {
            $width = $config['width'] * $scale * $multiplier;
        }
        if ($perc = $this->perc($config['height'])) {
            $height = $perc * $size[1] * $multiplier;
        } elseif ($config['height']) {
            $height = $config['height'] * $scale * $multiplier;
        }

        // Produce the Croppa URL
        $path = Croppa::url($this->getAttributeValue('file'),
            $width,
            $height,
            $config['options']
        );
        if ($path) {
            return asset($path);
        }
    }
public function urlify($size, $multiplier = 1)
    {
        // Get fluent config
        $config = $this->getConfig();

        // Setup vars
        $size = $this->sizes[$size];
        $scale = $size[0] / $this->bench;
        $width = $height = null;

        // Figure out percentage sizes.  First one of the dimensnios is tested
        // to see if it looks a percentage.  If so, make it a percentage of one of
        // the hard coded sizes.  Otherwise, scale the dimension by comaring the
        // size to a the benchmark (laptop).
        if ($perc = $this->perc($config['width'])) {
            $width = $perc * $size[0] * $multiplier;
        } elseif ($config['width']) {
            $width = $config['width'] * $scale * $multiplier;
        }
        if ($perc = $this->perc($config['height'])) {
            $height = $perc * $size[1] * $multiplier;
        } elseif ($config['height']) {
            $height = $config['height'] * $scale * $multiplier;
        }

        // Produce the Croppa URL
        $path = Croppa::url($this->getAttributeValue('file'),
            $width,
            $height,
            $config['options']
        );
        if ($path) {
            return asset($path);
        }
    }
public function urlify ( $ size , $ multiplier = 1 ) { // Get fluent config $ config = $ this -> getConfig ( ) ; // Setup vars $ size = $ this -> sizes [ $ size ] ; $ scale = $ size [ 0 ] / $ this -> bench ; $ width = $ height = null ; // Figure out percentage sizes.  First one of the dimensnios is tested // to see if it looks a percentage.  If so, make it a percentage of one of // the hard coded sizes.  Otherwise, scale the dimension by comaring the // size to a the benchmark (laptop). if ( $ perc = $ this -> perc ( $ config [ 'width' ] ) ) { $ width = $ perc * $ size [ 0 ] * $ multiplier ; } elseif ( $ config [ 'width' ] ) { $ width = $ config [ 'width' ] * $ scale * $ multiplier ; } if ( $ perc = $ this -> perc ( $ config [ 'height' ] ) ) { $ height = $ perc * $ size [ 1 ] * $ multiplier ; } elseif ( $ config [ 'height' ] ) { $ height = $ config [ 'height' ] * $ scale * $ multiplier ; } // Produce the Croppa URL $ path = Croppa :: url ( $ this -> getAttributeValue ( 'file' ) , $ width , $ height , $ config [ 'options' ] ) ; if ( $ path ) { return asset ( $ path ) ; } }
Make paths full URLs so these can be used directly in APIs or for Open
Graph tags, for example.

@param  string $size
@param  number $scale
@return string url
Make paths full URLs so these can be used directly in APIs or for Open Graph tags for example .