Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
<?php
namespace HiEvents\Validators\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class InsensitiveIn implements ValidationRule
{
protected array $values;
public function __construct(array $values)
{
$this->values = array_map('strtoupper', $values);
}
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (! in_array(strtoupper($value), $this->values, true)) {
$fail(':attribute must be one of '.implode(', ', $this->values));
}
}
}