0

Excuse me, I use laravel excel using blade and there are images on the cells.. I do file exist checking.. Like this:

        <?php if (file_exists('assets/images/upload/' . $row->photo)) { ?>
            <td width="50" margin="0"><img src="assets/images/upload/{{$row->photo}}" width="50"/></td>
        <?php } else { ?>
            <td></td>
        <?php } ?>

I try debug that file_exist() method and return true.. But When I try to generate that report, Laravel excel generating this error:

File assets/images/upload/my%20working%20directory.jpg not found! 
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
Khaneddy2013
  • 1,301
  • 1
  • 17
  • 25

1 Answers1

0

Finally, this is working:

<?php $image_url = str_replace(' ', '%20', $row->photo);
if (file_exists('assets/images/upload/' . $image_url)) { ?>
    <td width="50" margin="0"><img src="assets/images/upload/{{$image_url}}" width="50"/></td>
<?php } else { ?>
    <td></td>
<?php } ?>
Khaneddy2013
  • 1,301
  • 1
  • 17
  • 25