How to set custom attribute on required_if?

What seems to be the problem:

ErrorException
Array to string conversion

Steps to Reproduce:

public function rules() { return [
   'universityProgram' => ['required_if:type,student,graduate']
];}

public function customAttributes(){return [
       'type' => [
            'student' => 'estudiante',
            'graduate' => 'graduado o egresado'
        ],
 ];}

Are you using the latest version of Livewire:

Yes

Can you post the full code?

Is the field type a plain text input with a name that does not include []?