app/Http/Controllers/Auth/RegisterController.php
/**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
Get a validator for an incoming registration request.
@param  array  $data
@return \Illuminate\Contracts\Validation\Validator
Get a validator for an incoming registration request . @param array $data @return \ Illuminate \ Contracts \ Validation \ Validator
protected function validator(array $data)
    {
        $validator = Validator::make($data, [
            'fname'         => ['required', 'string', 'max:255'],
            'lname'         => ['required', 'string', 'max:255'],
            'email'         => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'password'      => ['required', 'string', 'min:8', 'confirmed'],
            'home_phone'    => ['required', 'string'],
            'cell_phone'    => ['required', 'string'],
            'address'       => ['required', 'string'],
            'city'          => ['required', 'string'],
            'state_id'      => ['required', 'integer'],
            'pcode'         => ['required', 'string'],
            'country_id'    => ['required', 'integer'],
            'grade_id'      => ['required', 'integer'],
            'subjects'      => ['required'],
            'parent_fname'  => ['required', 'string'],
            'parent_lname'  => ['required', 'string'],
            'street'        => ['required', 'string'],
            'school'        => ['required', 'string'],
            'referrer_id'   => ['required', 'integer'],
            'service_method'=> ['required', 'string']
        ]);
        if ($validator->fails()) {
            session()->flash('error', $validator->messages()->first());
        }
        return $validator;
    }
protected function validator ( array $ data ) { $ validator = Validator :: make ( $ data , [ 'fname' => [ 'required' , 'string' , 'max:255' ] , 'lname' => [ 'required' , 'string' , 'max:255' ] , 'email' => [ 'required' , 'string' , 'email' , 'max:255' , 'unique:users' ] , 'password' => [ 'required' , 'string' , 'min:8' , 'confirmed' ] , 'home_phone' => [ 'required' , 'string' ] , 'cell_phone' => [ 'required' , 'string' ] , 'address' => [ 'required' , 'string' ] , 'city' => [ 'required' , 'string' ] , 'state_id' => [ 'required' , 'integer' ] , 'pcode' => [ 'required' , 'string' ] , 'country_id' => [ 'required' , 'integer' ] , 'grade_id' => [ 'required' , 'integer' ] , 'subjects' => [ 'required' ] , 'parent_fname' => [ 'required' , 'string' ] , 'parent_lname' => [ 'required' , 'string' ] , 'street' => [ 'required' , 'string' ] , 'school' => [ 'required' , 'string' ] , 'referrer_id' => [ 'required' , 'integer' ] , 'service_method' => [ 'required' , 'string' ] ] ) ; if ( $ validator -> fails ( ) ) { session ( ) -> flash ( 'error' , $ validator -> messages ( ) -> first ( ) ) ; } return $ validator ; }
Get a validator for an incoming registration request.
Get a validator for an incoming registration request .