can be nullable and must be unique validation in laravel
问题 $this->validate($request, [ 'id_num' => 'required | unique:users', //this should be nullable not required with unique. ]); Is it possible to nullable + unique at a time? then what will be the procedures? 回答1: Simply remove the required from the validator. Is it possible to nullable + unique at a time? Yes then what will be the procedures? You don't need a procedure, declare the field as unique in the table migration. $table->unique('id_num')->nullable(); then your validator must look like: