mercredi 24 juin 2020

laravel eger loading not working properly when i use limit or take in whereIn

helllo my code is

$all_5_post = wp_terms::with(['wp_posts' => function ($query) {
                                      $query->orderBy('id', 'desc')->take(5);
                                }])->whereIn('id',[3,4,6,9])->get();

getting relationship data in 3 id but 4,6,9 relationship data getting empty but when i only use WHERE elequent and doing multiple query for same 3,4,6,9 id it showing 5 relationship table data in each what i have to do now i need a solution.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire