samedi 29 avril 2017

getting image with if condition in laravel 5.4

I try to print uploaded image by user in Laravel 5.4 with if condition and if user does not uploaded any image to show default image but my code prints nothing somehow, this the code i use:

@if (File::exists($post->image))
    {
        echo "<img src="" alt="" />";
    } else {
        echo "<img src="" alt="" />";
    }
@endif

Aucun commentaire:

Enregistrer un commentaire