Skip to content

Unique Rule - where parameter closure #1081

@MarkusJLechner

Description

@MarkusJLechner

✏️ Describe the bug
See spatie/laravel-data/src/Attributes/Validation/Unique.php
https://github.com/spatie/laravel-data/blob/main/src/Attributes/Validation/Unique.php#L23

Attribute does not allow Closures, how to use that parameter?
Laravel's $rule->where allows whereIn array, which would at least work

↪️ To Reproduce
Using Unique Attribute with where closure.

✅ Expected behavior
Where should be at least usable as array

🖥️ Versions

Laravel: 12
Laravel Data: 4.17
PHP: 8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions