lundi 14 mars 2016

serverfireteam/panel validation:how to check for unique value in column

I'm using Laravel with serverfireteam/panel and i need that the validation checks for a unique value in column. I tested this:

$this->edit->add('nr','Nummer','text')->rule('required')->rule('unique:nr');

result Query:

SQL: select count(*) as aggregate from `nr` where `nr` = 22

and this:

$this->edit->add('nr', 'Nummer','text')->rule('required')->rule('unique:.kunden nr');

wich results in:

(SQL: select count(*) as aggregate from `kunden nr` where `nr` = 22)

Is it possible to check for uniquenes with rules in serverfireteam/panel and how does it work?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire