app/Http/Requests/ContactUsRequest.php
/**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
Get the validation rules that apply to the request.
@return array
Get the validation rules that apply to the request . @return array
public function rules()
    {
            return [
                'name' => ['required', 'string', 'min:3', 'max:256'],
                'email' => ['required', 'email'],
                'department' => [
                    'nullable', 
                    'string', 
                    Rule::in(['administrative','acounting', 'depTechnical', 'depLogistic',]),
                 ],
                 'message' => [
                     Rule::requiredIf((bool)$this->input('departament')), 
                     'string', 
                     'min:10', 
                     'max:1000'
                 ],
                'readTerms' => ['required', 'boolean']
             ];            
    }
public function rules ( ) { return [ 'name' => [ 'required' , 'string' , 'min:3' , 'max:256' ] , 'email' => [ 'required' , 'email' ] , 'department' => [ 'nullable' , 'string' , Rule :: in ( [ 'administrative' , 'acounting' , 'depTechnical' , 'depLogistic' , ] ) , ] , 'message' => [ Rule :: requiredIf ( ( bool ) $ this -> input ( 'departament' ) ) , 'string' , 'min:10' , 'max:1000' ] , 'readTerms' => [ 'required' , 'boolean' ] ] ; }
Get the validation rules that apply to the request.
Get the validation rules that apply to the request .