Laravel's wildcard validation is O(n²), here's a fix
I was profiling a slow import endpoint. 100 items, 47 fields each with exclude_unless and required_if. Endpoint took 3.4 seconds. I assumed database queries. Validation alone was 3.2s. When you write items..name => required|string|max:255, Laravel's explodeWildcardRules() flattens data with Arr::dot...


Unfortunately you get a templated response most of the time. Some of my PRs were closed with the comment that it lacked solid benchmarks. So I made a benchmark application and resubmitted with proper benchmarks, then it got closed without a comment. I would love to get some of these performance boosts into the framework, but I'm afraid it's not happening anytime soon.
Sure! Though sometimes it just is what it is, for example in a JSON import you want to validate, or even a CSV import. It also gets slow pretty quick when you have a couple of wildcards in your validation rules
To be fair, it's impressive that he still merges all PRs by himself on top of all his other work. I do understand it's difficult to balance and to commit to maintaining all the PRs as well
You indeed rarely run into real bottlenecks until you have a bit more complicated data shapes. But it happens quite quickly when you have a couple fields that are array shaped and have a couple fields in each, add some conditional rules and the performance starts getting way too slow to justify
It's been tested on several complex repo's with nested arrays, but maybe you have a specific structure in mind. Share an example and I can test and benchmark it :)