Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

why are you doing this ?

$header = json_decode(json_encode($header), true);

you can simply check if it has records using !is_null or $header->count() or you can do $header instanceOf Illuminate\Support\Collection

you have so many loops, why not use a join statement and let mysql do the calculations for you.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

zaidysf zaidysf Joined 10 Jul 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.