jeudi 27 août 2015

Laravel 5 how to make loop in loop

How can i make loop like this in laravel?

I have category and posts table ,
on posts table there is field for category id.

And some categories has no post , so i dont want to show empty categories on my view..

Sorry for my english . I hope you understand me

Loop:Category {

$categoryname

Loop:PostsBelongsToCategory {

$postTitle

}
}

I want to print it to page like this :

Category 1 :

Category 1 Post A ,

Category 1 Post B ,

Category 1 Post C ,

Category 2 :

Category 2 Post A ,

Category 2 Post B ,

Category 2 Post C ,



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

Aucun commentaire:

Enregistrer un commentaire