Skip to content

Conversation

@shaedrich
Copy link
Contributor

@shaedrich shaedrich commented Oct 29, 2024

Revive #21672 by @vanodevium

That allows to do something like this:

class MyRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'user_uuid' => [ 'required', 'uuid' ], // default, unchanged
            'order_uuid' => [ 'uuid:4' ],
            'request_uuid' => [ 'uuid:1' ],
        ];
    }
}

@taylorotwell
Copy link
Member

Can you add a test and mark as ready for review?

@taylorotwell taylorotwell marked this pull request as draft October 30, 2024 14:06
Suggested-by: Vano Devium <vano@devium.me>
cc: Vano Devium <vano@devium.me>
thanks-to: Vano Devium <vano@devium.me>
original-patch-by: Vano Devium <vano@devium.me>
based-on-a-patch-by: Vano Devium <vano@devium.me>
based-on-patch-by: Vano Devium <vano@devium.me>
credit-to: Vano Devium <vano@devium.me>
inspired-by-patch-by: Vano Devium <vano@devium.me>
initial-work-by: Vano Devium <vano@devium.me>
inspired-by: laravel#21672
Suggested-by: Vano Devium <webdevium@gmail.com>
cc: Vano Devium <webdevium@gmail.com>
thanks-to: Vano Devium <webdevium@gmail.com>
original-patch-by: Vano Devium <webdevium@gmail.com>
based-on-a-patch-by: Vano Devium <webdevium@gmail.com>
based-on-patch-by: Vano Devium <webdevium@gmail.com>
credit-to: Vano Devium <webdevium@gmail.com>
inspired-by-patch-by: Vano Devium <webdevium@gmail.com>
initial-work-by: Vano Devium <webdevium@gmail.com>
inspired-by: laravel#21672
@shaedrich shaedrich marked this pull request as ready for review October 30, 2024 23:05
@shaedrich
Copy link
Contributor Author

Tests are added as asked

@taylorotwell taylorotwell merged commit 0dfeef5 into laravel:master Oct 31, 2024
31 checks passed
@shaedrich shaedrich deleted the validate-uuid-version branch October 31, 2024 17:45
shaedrich added a commit to shaedrich/framework that referenced this pull request Oct 31, 2024
– Remove unused imports
– Spacing

improves: laravel#53341
taylorotwell added a commit that referenced this pull request Nov 1, 2024
* feat: ✨ Add support for UUID v2 and max UUID validation

* test: ✅ Add cases for every supported UUID version to data provider of UUID validation tests

* style: 🎨 Fix StyleCI errors

– Remove unused imports
– Spacing

improves: #53341

* Add missing import

* style: 🎨 Remove indent from blank line

* Add ramsey/uuid to composer suggestions

to be able to use it for UUID version constraint validation

* Update Str.php

* Update Str.php

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants