public function scopeType($query, $id) { $types = ProductType::lists('name', 'id'); if ($id != "" && isset($types[$id])) { $query->where('product_type_id', $id); } }
public function scopeType($query, $id) { $types = ProductType::lists('name', 'id'); if ($id != "" && isset($types[$id])) { $query->where('product_type_id', $id); } }