1use Illuminate\Validation\Rule;
2
3public function rules()
4{
5 return [
6 'title' => [
7 'required',
8 Rule::unique('posts', 'title')->ignore($this->post)
9 ]
10 ];
11}
12
1unique:table,column,except,idColumn
2
3############## Example : ################
4
5############### For Updating
6//rules
7'email' => 'unique:users,email_address,' . $userId,
8
9############### For Creating
10//rules
11'email' => 'unique:users,email_address',