$data * @return array */ protected function mutateFormDataBeforeSave(array $data): array { $actor = auth()->user(); $record = $this->getRecord(); if (! $actor instanceof User || ! $record instanceof User || ! $actor->mayResetCredentials($record)) { unset($data['password']); } return $data; } }