samedi 25 mai 2019

How I Print table descending order while use foreach in laravel?

I already print the table from SQL DB in my laravel application but I want to print it I descending order.

I already tried.

  @foreach( $categories->all()->orderBy('id desc') as $category )

But it is not worked. Help Me!!

@foreach( $categories->all() as $category )
<tr>
  <td></td>
  <td></td>
  <td></td>
  <td></td>
  <td>Edit</td>
  <td>Delete</td>
</tr>
@endforeach



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2QoUsyW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire