I have a “vehicles” table with a unique column called “vehicle_number.” When adding a new vehicle, I can easily validate if the “vehicle_number” is unique.
$request->validate([
'vehicle_number' => 'required|unique:vehicles|max:255'
]);
However, when I try to update a vehicle, I encounter an issue where it says “vehicle_number” already exists, preventing any updates. How can I set up validation in Laravel to allow the same “vehicle_number” during the update?