Monday, April 10, 2017

Laravel validation with enum column

I have this fields:

id, title, type

type is enum And I would like to validate my title by Type column, eg:

id | title | type
1 | test | option1
2| test | option2

So when someone tries to insert a row with this condition, validation should be processed for unique of the column.

3 | test | option1 ==> should not be insert due unique validation rule.

How will my validation rule look like?

Regards



via Payam Khaninejad

Advertisement