public function generateImageAddress(string $image, $method = null)
    {
        if ($method == Input::IMG_BASE64) {
            return ['base64' => $image];
        } elseif ($method == Input::IMG_PATH) {
            if (!file_exists($image)) {
                throw new FileNotFoundException($image);
            }

            return ['base64' => base64_encode(file_get_contents($image))];
        } else {
            return ['url' => $image];
        }
    }
public function generateImageAddress(string $image, $method = null)
    {
        if ($method == Input::IMG_BASE64) {
            return ['base64' => $image];
        } elseif ($method == Input::IMG_PATH) {
            if (!file_exists($image)) {
                throw new FileNotFoundException($image);
            }

            return ['base64' => base64_encode(file_get_contents($image))];
        } else {
            return ['url' => $image];
        }
    }
public function generateImageAddress ( string $ image , $ method = null ) { if ( $ method == Input :: IMG_BASE64 ) { return [ 'base64' => $ image ] ; } elseif ( $ method == Input :: IMG_PATH ) { if ( ! file_exists ( $ image ) ) { throw new FileNotFoundException ( $ image ) ; } return [ 'base64' => base64_encode ( file_get_contents ( $ image ) ) ] ; } else { return [ 'url' => $ image ] ; } }
Generate Image With Download Type

@param $image
@param null $method

@return array
Generate Image With Download Type