jeudi 24 décembre 2015

unique_with laravel:It doesnt work if a particular row is ignored using id

I am using laravel 5.0 and unique_with feature isnt working properly if i want to ignore a particular row using id field.In my database,the id field is named '_id'.Here's my code:

$test=Request::segment(2);

The $test retrieves the id from url properly and the name field is validated using following:

'name' => 'Required|http://Regex:/[a-zA-Z0-9]+\.+[a-zA-Z0-9]+\.+[a-zA-Z0-9]/|Max:100|unique_with:permissions,deleted_at,$test=_id',

But this isn't working.It allows editing/creating even if name is duplicate whereas it should have done just the opposite!! Any suggestions?

Thanks in advance!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire