src/Concerns/Thumbnail.php
public function thumbnail($width, $height = null)
    {
        if ($this->type != 'image') {
            throw new \LogicException("Tried to create thumbnail for not image file.", 500);
        }

        $thumbnail = new \Routegroup\Media\Helpers\Thumbnail($this);

        $filename = $thumbnail->name($width, $height);

        if ($thumbnail->exists($filename)) {
            return $this->storage->url($this->path($filename));
        }

        return $thumbnail->create($filename, $width, $height);
    }
public function thumbnail($width, $height = null)
    {
        if ($this->type != 'image') {
            throw new \LogicException("Tried to create thumbnail for not image file.", 500);
        }

        $thumbnail = new \Routegroup\Media\Helpers\Thumbnail($this);

        $filename = $thumbnail->name($width, $height);

        if ($thumbnail->exists($filename)) {
            return $this->storage->url($this->path($filename));
        }

        return $thumbnail->create($filename, $width, $height);
    }
public function thumbnail ( $ width , $ height = null ) { if ( $ this -> type != 'image' ) { throw new \ LogicException ( "Tried to create thumbnail for not image file." , 500 ) ; } $ thumbnail = new \ Routegroup \ Media \ Helpers \ Thumbnail ( $ this ) ; $ filename = $ thumbnail -> name ( $ width , $ height ) ; if ( $ thumbnail -> exists ( $ filename ) ) { return $ this -> storage -> url ( $ this -> path ( $ filename ) ) ; } return $ thumbnail -> create ( $ filename , $ width , $ height ) ; }
Gets thumbnail for given sizes.

@param  integer $width
@param  integer $height
@return string
Gets thumbnail for given sizes .