Properties Table
| id | name |
|---|---|
| 1 | abc |
| 2 | xyz |
I want to check if the name exists during edit but if it is the same Property then ignore it.
When I want to insert using this code
$ruls = [
'property_type' => 'required',
'project_name' => 'required|unique:properties,name',
];
$request->validate($ruls, []);
and I want to using same validation when property edit like
select name from properties where name = name and id != 1
Please help me to solve this issue.