mercredi 30 juin 2021

print results in descending order

I need to print results in a decreasing way

controller:

$servicios = \App\Models\Eventos::All()->sortByDesc('hora');

blade.php

  @foreach ($servicios as $hoy)
                                        <tr>
                                            <td class="checkbox-column text-center"> </td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td></td>
                                            <td class="text-center"><span class="shadow-none ">
                                            @if($hoy->prioridad == 'badge badge-primary') 
                                          Normal
                                            @elseif($hoy->prioridad == 'badge badge-warning') 
                                           Prioridad
                                             @elseif($hoy->prioridad == 'badge badge-success') 
                                          Personal
                                             @elseif ($hoy->prioridad == 'badge badge-danger') 
                                           Urgente
          

                                            @endif
                                            
                                            </span></td>
                                        
                                        @endforeach

enter image description here

the problem is that it does not print with the foreach with the DESC order



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3AgNcLZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire