#274

Hello, add the Rules class and this to the email validation

use Illuminate\Validation\Rules;

public function update(Request $request, User $user) {

$update = $request -> validate([
‘name’ => [‘required’, ‘max:255′],
’email’ => [‘required’, ’email’, Rule::unique(User::class)->ignore($user->id)],
]);

$user -> update($update);

}

What it does is it ignore the unique validation method if the id matches the user being specified injected.