1 year ago

Hide if file doesn't exist

Posted 1 year ago by ziben69

Hello guys, I have file.blade.php.

I need to hide empty files records in view:

 <div class="row">
      @foreach($files as $file)
      <div class="col-md-4" style="margin-bottom:10px;">
             <div class="card">
                     <div class="card-body">
                            <strong>{{ $file->title }}</strong>
                            <p class="card-text">
                                    {{ $file->created_at->diffForHumans() }}
                            <a href="{{ route('downloadSenior', $file->id) }}"><i class="fa fa-download" aria-hidden="true"></i> Download</a>

How can I hide this part of view when file doesn't exist. Now I have empty links because in my DB are 30 rows without files. I should change:


?? Thanks for help!

Please sign in or create an account to participate in this conversation.