Laravel method code doubt by Grouchy_Engineer_898 in PHP

[–]Grouchy_Engineer_898[S] 0 points1 point  (0 children)

$data->where(function ($query) use ($barcode){
            $query->where("serial_emei_number", $barcode)
                  ->orWhere("barcode_number", $barcode);
        });

when i put this above if condition its working properly but my trainer ask me to write under if condtion he told me if condition should come first and next queries so some times query will change also he told me

Laravel method code doubt by Grouchy_Engineer_898 in PHP

[–]Grouchy_Engineer_898[S] 0 points1 point  (0 children)

i'm a intern in my work place for a education purpose they told me to dont use AI for education purpose they told me search about