public function response($extension = null)
    {
        if (!is_null($extension)) {
            $this->extension($extension);
        }
        if (method_exists($this, 'cacheable') && $this->cacheable()) {
            if (!$this->cached()) {
                $this->apply();
                $this->cache($this->handle());
            }
            $age = config('images.cache_age', '86400');

            return $this->cached()
                        ->response($extension)
                        ->setLastModified(new \DateTime('now'))
                        ->setExpires(new \DateTime('@'.(time() + $age)));
        }
        $this->apply();

        return $this->handle()->response($extension);
    }
public function response($extension = null)
    {
        if (!is_null($extension)) {
            $this->extension($extension);
        }
        if (method_exists($this, 'cacheable') && $this->cacheable()) {
            if (!$this->cached()) {
                $this->apply();
                $this->cache($this->handle());
            }
            $age = config('images.cache_age', '86400');

            return $this->cached()
                        ->response($extension)
                        ->setLastModified(new \DateTime('now'))
                        ->setExpires(new \DateTime('@'.(time() + $age)));
        }
        $this->apply();

        return $this->handle()->response($extension);
    }
public function response ( $ extension = null ) { if ( ! is_null ( $ extension ) ) { $ this -> extension ( $ extension ) ; } if ( method_exists ( $ this , 'cacheable' ) && $ this -> cacheable ( ) ) { if ( ! $ this -> cached ( ) ) { $ this -> apply ( ) ; $ this -> cache ( $ this -> handle ( ) ) ; } $ age = config ( 'images.cache_age' , '86400' ) ; return $ this -> cached ( ) -> response ( $ extension ) -> setLastModified ( new \ DateTime ( 'now' ) ) -> setExpires ( new \ DateTime ( '@' . ( time ( ) + $ age ) ) ) ; } $ this -> apply ( ) ; return $ this -> handle ( ) -> response ( $ extension ) ; }
Generate laravel response.

@param type   $path      File path
@param string $extension Extension, jpg by default

@return response
Generate laravel response .