lundi 10 décembre 2018

how to check if file exist or not laravel 5.7

i want to create condition to check if file exist or not.

here what i try

<div class="text-center col-sm-12">
    @if(file_exists('/files/'.$employees->profile_img))
    <img src="" class="rounded float-right" width="100%" height="150" alt="">
    @else
    <img src="" class="rounded float-right" width="100%" height="150" alt="">
    @endif
</div>

but it not working.

file directory file is D:\Kerjaan_Jazuly\xampp\htdocs\jobmonitorweb\public\storage\files

i store all files to files folder.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire