merge([ 'phone' => str_replace(['+', '(', ')', '-', ' '], '', $this->phone), ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { if ($this->isMethod('get')) { return []; } return [ 'username' => [ 'required', 'string', ], ]; } }