コード例 #1
0
 /**
  * find in query with key and value eg [id=>[1,2]]
  *
  * @param  array $criteria
  * @return Collection
  */
 public function findByKey($criteria)
 {
     $key = key($criteria);
     $values = $criteria[$key];
     return $this->question->whereIn($key, $values)->get();
 }