mardi 23 août 2016

How to display image from aws s3 in blade laravel 5.2

I have created a method for getting the data(image file) from aws S3 like this :

 public static function getImage ($imagePath)
    {
        if(Storage::exists($imagePath))
        {
            return Storage::disk('s3')->get($imagePath);
        }else
        {
            return 'No Image';
        }
    }

I'm sure that those image is exist on the aws, so there is no problem with that. And then I use above method as the src in my blade view like this :

{!!Html::image(getImage($myPath),'logo',['width'=>60,'height'=>55])!!}

$myPath here already point to the specific file on aws for example : bucket/file.jgp. But when I run my webpage, this Html::Image gives a view like this : enter image description here

What's going on here ? Why Html::image can't render my image file ? :(



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire