mardi 8 décembre 2020

laravel unique field validation rules on update

My property listing form contains a unique reference id , while adding it works fine, but while editing on save i get an error --- "The reference has already been taken".

public $validationRules = [
        'property_type_id' => 'required',
        'property_category_id' => 'required',
        'referance' => 'required|min:5|unique:properties',
    ];

How to write the rules for update



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire