jeudi 21 mai 2020

Unique phone number checks with ignoring soft delete record - Laravel

I want to add validations on my customers table. I am trying to ignore soft delete record and check uniqueness on phone number of active record.

$validation = Validator::make($data, [
            'phone_number' => 'required|unique:customers,deleted_at,NULL',
            'location_coordinates' => 'required',
            'address' => 'required',
            'location' => 'required',
            'name' => 'required'
        ]);

The field name is phone_number.

Its not working. Any help would be appreciable. Thanks.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3bSLzXv
via IFTTT

Aucun commentaire:

Enregistrer un commentaire