mardi 25 décembre 2018

Method Illuminate\Database\Eloquent\Collection::orWhere does not exist

I got problem Method Illuminate\Database\Eloquent\Collection::orWhere does not exist. I just wanna use orWhere on that case

I tried adding ->get() in the last query but it still error

$category = Auth::user()->division->allCode->where('parent', '0')->where('info_code', 'code_h')
            ->orWhere('info_code','=', 'code_m')->where('parent', '0');

I want to use or where in this case and get the result. here the logic I want

(parent==0 && info_code == code_h) || (parent==0 && info_code == code_m)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire