I'm trying to use a scope that is loaded by a trait onto a specific model so it does it on every query from that model
BUT
The query isn't working
public function apply(Builder $builder) {
$builder->where(function($q){$q->whereIn('region_id', array(1,2))
->orWhere('manager_id', 1);
});
}
This is what it is supposed to do but the page doesn't load, so I checked apache error logs and got a :
[core:notice] [pid 949] AH00051: child pid 2647 exit signal Segmentation fault (11), possible coredump in /etc/apache2
BUT if I apply the same creteria to just a query, then it works :S
Client::where(function($q){
$q->whereIn('region_id', array(1,2))
->orWhere('manager_id', 1);
})->get();
So what is wrong here? It looks like the builder doesn't like taking functions, because it doesn't matter what I put in the function, it just doesn't work