'required|string', 'email' => 'required|email', 'phone_number' => 'required|regex:/^([0-9\s\+]*)$/i|min:12|max:15', 'locations' => 'required|array', 'mission' => 'nullable|string', 'rodo' => 'nullable|string', 'position' => 'nullable|string', 'notes' => 'nullable|string', 'sended' => 'nullable|boolean', ]; } protected function prepareForValidation(): void { $this->merge([ 'sended' => $this->toBoolean($this->sended), ]); } private function toBoolean($booleable): bool { return filter_var($booleable, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } }