Sunday, February 25, 2018

Laravel unique validation - development

Laravel unique validation

How can I perform this migration rule to laravel validation rule

$table->unique(['field_1', 'field_2']);

so far I tried this but I still got no result?

$rules = [
            'slug' => 'required|max:70|unique:categories,slug,null,id,category_type,' . Blog::class . '|regex:/(^[A-Za-z-_ ]+$)+/',
            'title' => 'required|max:70',
        ];



from Laravel Questions and Answers https://laravelquestions.com/php/laravel-unique-validation/
via Lzo Media

No comments:

Post a Comment