We won't just write the code for you. The Getting Started guide has information on all the relevant topics for this kind of code, though.
franzliedke said:
We won't just write the code for you. The Getting Started guide has information on all the relevant topics for this kind of code, though.
okay, so maybe you can give me some logic tips about what i trying to achieve, if you notice, my code is having n+1 problems since i need to 1 while loops for showing categories article and another while loops inside it for showing each article for categories and put them in the corret posittion
categories
article
article
article
so i tried to come up with this eloquent and it show categories and article for categories but only one article per categories..... maybe there is something i miss?
$beritas = Artikel::with('KategoriArtikel')
->where('pilihan','=','0')
->orderBy('created_at','desc')
->groupBy('kategori')
->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community