mardi 2 octobre 2018

Can I Use 2 foreach from variable database in laravel?

enter image description here

I Want make foreach in behind loping

    $aproval = Aproval_position::get();
    $user = User::get();
    return view('authentication.index_aproval', compact('user','aproval'));

this view blade

                      @foreach($aproval as $approv)
                                      <label for="" class="col-lg-3"></label>                                 
                                               <select>
                                                @foreach($user as $user)
                                                        <option value=""></option>
                                                @endforeach

                                            </select> 
                       @endforeach

but when I try to use foreach user inside looping aproval thats error, I want use User foreach table 2x or more but can't, can you give me recomended way to use that ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire