mercredi 7 mars 2018

how to get columns name by columns value in laravel

table(skill) enter image description here have many skills, columns type boolean(0,1),by laravel i want to get the names of columns if skills value equal 1 and user_id equal 1, without say the name of column becouse they 50 skills ,i tried this on sublime

 <?php
             $variable2=App\Skill::where('user_id',Auth::user()->id)
                                 ->where('job_id','null')
                                 ->get();

                ?>


                    @foreach($variable2 as $key1 => $value1)

                    @if($value1='1')
                    <span class="tags"></span>
                    @endif 
                   @endforeach



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2Fy8BGZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire