Fixed Eloquent query builder withTrashed method when used with nested where or whereRaw.