mercredi 27 décembre 2017

why did not save form data in Laravel?

I am using Auth: command register form in My laravel application. and I have add new nic input box to register.blade.php file as this, register.blade.php

 <div class="form-group">
                            <label for="nic" class="col-md-4 control-label">NIC</label>

                            <div class="col-md-6">
                                <input id="nic" type="text" class="form-control" name="nic">

                                @if ($errors->has('nic'))
                                    <span class="help-block">
                                        <strong></strong>
                                    </span>
                                @endif
                            </div>
                        </div>

and MY AuthController is like this,

protected function validator(array $data)
    {
        return Validator::make($data, [
            'username' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6|confirmed',
            'nic' => 'required|min:10',
            ]);
    }

    protected function create(array $data)
    {
        return User::create([
            'username' => $data['username'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'nic' => $data['nic'],
        ]);
    }

and I have new column as nic in Users table as well. but when I click register button other data values saving well in users table but nic column not saving nic values. how can solve this problem?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire