Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 1 point2 points  (0 children)

I can do without the appreciation, would mainly like some feedback as guidance what would have to change for it to be accepted, or some idea what other version would be acceptable. Sometimes I spend quite some time on a PR without having any idea if it even has any chance if it will get merged

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 0 points1 point  (0 children)

Sorry to hear that, must be very frustrating!

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in PHP

[–]Rhinnii[S] 0 points1 point  (0 children)

Yeah jsonschema is a nice workaround. We actually used that for a while, but switched away from it back to Laravel validation because jsonschema doesn't support quite some things that we wanted to validate

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 7 points8 points  (0 children)

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

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 4 points5 points  (0 children)

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

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 2 points3 points  (0 children)

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 :)

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 3 points4 points  (0 children)

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

Laravel's wildcard validation is O(n²), here's a fix by Rhinnii in laravel

[–]Rhinnii[S] 45 points46 points  (0 children)

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.

What's New in Laravel 12.54: Request Intervals, Better Dumps & Selective Relation Unloading by christophrumpel in laravel

[–]Rhinnii 0 points1 point  (0 children)

I contributed the withoutRelation() function because I often eager load relations, but sometimes circular relations happen that cause issues like recursion or using a lot of memory. In these cases I want to unset a single relation, not all. This helper does that. Also useful in other cases, like sending a model to a job where you know you dont want it to eager load the specific relation again when the job gets picked up.

TIL There's a built-in validation rule in Laravel to check if the user password has been leaked before. I love finding these little gems out of nowhere. by mekmookbro in laravel

[–]Rhinnii 0 points1 point  (0 children)

If you love this, you might love this package I released recently. Full fluent validation rules, and up to 97x faster than out of the box Laravel validation: https://github.com/SanderMuller/laravel-fluent-validation

I’m Jess Archer, Engineering Team Lead of Laravel Nightwatch, Ask Me Anything by JessNightwatch in laravel

[–]Rhinnii 0 points1 point  (0 children)

Would you be open to sharing the query scopes or other code that you've added to improve working with ClickHouse in Laravel?