ziben69
10 months ago

Laravel Blade | Hide if DB data doesn't exists

Posted 10 months ago by ziben69

Hello guys,

How can I hide div if rows doesn't exists?

No I have something like this:

@foreach($metaList as $meta)
@if (empty($meta->id))
       <div class="row">
              <div class="col-lg-12">
                    <a href="{{ URL::to('meta/create') }}" class="btn btn-md btn-primary waves-effect waves-light"><i class="fas fa-plus-square"></i> Create</a><br><br>
              </div>
        </div>
@endif
@endforeach

but it doesn't work :/ I need hide element when data doesn't exists and show when exists. Thanks for help.

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