jeudi 10 mars 2016

Title need to be unique based upon the grade and subject

Title need to be unique based upon the grade and subject. I need to add like this

grade   subject     title
2       english     abc
2       english     abc    -> need validation error
3       english     abc    -> no validation error

How would I do this validation in larevels?

I did this

'title'=>'required|unique:titles,title',

In here title coloumn become unique but not consider the subject and grade.

grade   subject     title
2       english     abc
2       english     abc    -> get validation error
3       english     abc    -> get validation error



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire