K
K
kolyafat2016-04-09 11:50:05
Cataloging
kolyafat, 2016-04-09 11:50:05

Listing directories on laravel?

Good afternoon to all readers, please tell me why this construction does not work:

@forelse ($gro as $gr)
       <div class="container"> 
    <div class="col-md-5">
        <h1><p><strong>{{$gr->name_group}}</strong></p></h1>
    </div></div>
       
      <?php $fi=$find->where('c_id_group_item', $gr->c_id_group); ?> 

       @if($fi)
  @include('items', ['items' => $fi])
@endif

@empty
БЛА БЛА БЛА!
    @endforelse

When the execution occurs in the items template, the structure turns out to be correct, but for some reason the items themselves display one for the group, please tell the knowledgeable people what I'm doing wrong, or how best to implement it, thanks ...
Yes, the items template code:
@foreach ($items as $fi)
   <div class="container"> 
    <div class="col-md-5">
 @if (!empty(($fi->number)&& ($fi->shortname)))  
    {{$fi->name_item}}
  </div>
</div>
 @endif
@endforeach

$fi is filled with sorting....

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2016-04-09
@kolyafat

<?php $fi=$find->where('c_id_group_item', $gr->c_id_group); ?>

What is it? Why not use normal relationships in the model (hasMany for example)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question