where('code', strtoupper($value)); if ($this->activeOnly) { $query->where('is_active', true); } if (! $query->exists()) { $fail('The :attribute must be a supported ISO 3166-2 subdivision code.'); } } }