Astrotomic / laravel-translatable

A Laravel package for multilingual models
https://docs.astrotomic.info/laravel-translatable/
MIT License
1.22k stars 152 forks source link

How to apply unique validation with locale #374

Closed backdevelopend closed 6 months ago

backdevelopend commented 6 months ago

In my translations table I need unique name with locale. How can I validate this?

public function rules(): array
    {
        return RuleFactory::make([
            '%name%' => ['required', Rule::unique('table_translations', 'name')->where('locale', ????)]
        ])
    }
github-actions[bot] commented 6 months ago

This issue is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days