title: Data not inserting laravel mysql
body: <p>I am trying to insert data in mysql database in laravel, default table users, while submitting the form is refreshing and data is not inserting to database, no error is showing. I dont know where is the problem. My code is given.</p>
  
  <p>register.blade.php</p>
  
  <pre><code>@extends('layouts.app')
  
  @section('content')
  &lt;div class="container"&gt;
      &lt;div class="row justify-content-center"&gt;
          &lt;div class="col-md-8"&gt;
              &lt;div class="card"&gt;
                  &lt;div class="card-header"&gt;{{ __('Register') }}&lt;/div&gt;
  
                  &lt;div class="card-body"&gt;
                      &lt;form method="POST" action="{{ route('register') }}"&gt;
                          @csrf
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="name" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Teacher Name') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="tname" type="text" class="form-control{{ $errors-&gt;has('name') ? ' is-invalid' : '' }}" name="tname" value="{{ old('tname') }}" required autofocus&gt;
  
                                  @if ($errors-&gt;has('tname'))
                                      &lt;span class="invalid-feedback" role="alert"&gt;
                                          &lt;strong&gt;{{ $errors-&gt;first('tname') }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="fname" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Father Name') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="name" type="text" class="form-control{{ $errors-&gt;has('name') ? ' is-invalid' : '' }}" name="fname" value="{{ old('name') }}" required autofocus&gt;
  
                                  @if ($errors-&gt;has('fname'))
                                  &lt;span class="invalid-feedback" role="alert"&gt;
                                      &lt;strong&gt;{{ $errors-&gt;first('fname') }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="domicile" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Domicile') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="domicile" type="text" class="form-control{{ $errors-&gt;has('domicile') ? ' is-invalid' : '' }}" name="domicile" value="{{ old('domicile') }}" required autofocus&gt;
  
                                  @if ($errors-&gt;has('domicile'))
                                  &lt;span class="invalid-feedback" role="alert"&gt;
                                      &lt;strong&gt;{{ $errors-&gt;first('domicile') }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="string" class="col-md-4 col-form-label text-md-right"&gt;{{ __('C.N.I.C') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="nic" type="text" class="form-control{{ $errors-&gt;has('nic') ? ' is-invalid' : '' }}" name="nic" value="{{ old('nic') }}" required autofocus&gt;
  
                                  @if ($errors-&gt;has('nic'))
                                  &lt;span class="invalid-feedback" role="alert"&gt;
                                      &lt;strong&gt;{{ $errors-&gt;first('nic') }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="name" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Phone') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="name" type="text" class="form-control{{ $errors-&gt;has('name') ? ' is-invalid' : '' }}" name="phone" value="{{ old('name') }}" required autofocus&gt;
  
                                  @if ($errors-&gt;has('name'))
                                  &lt;span class="invalid-feedback" role="alert"&gt;
                                      &lt;strong&gt;{{ $errors-&gt;first('name') }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="email" class="col-md-4 col-form-label text-md-right"&gt;{{ __('E-Mail') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="email" type="email" class="form-control{{ $errors-&gt;has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required&gt;
  
                                  @if ($errors-&gt;has('email'))
                                      &lt;span class="invalid-feedback" role="alert"&gt;
                                          &lt;strong&gt;{{ $errors-&gt;first('email') }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="email" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Official E-Mail') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="email" type="email" class="form-control{{ $errors-&gt;has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required&gt;
  
                                  @if ($errors-&gt;has('email'))
                                  &lt;span class="invalid-feedback" role="alert"&gt;
                                      &lt;strong&gt;{{ $errors-&gt;first('off_email') }}&lt;/strong&gt;
                                  &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="password" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Password') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="password" type="password" class="form-control{{ $errors-&gt;has('password') ? ' is-invalid' : '' }}" name="password" required&gt;
  
                                  @if ($errors-&gt;has('password'))
                                      &lt;span class="invalid-feedback" role="alert"&gt;
                                          &lt;strong&gt;{{ $errors-&gt;first('password') }}&lt;/strong&gt;
                                      &lt;/span&gt;
                                  @endif
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row"&gt;
                              &lt;label for="password-confirm" class="col-md-4 col-form-label text-md-right"&gt;{{ __('Confirm Password') }}&lt;/label&gt;
  
                              &lt;div class="col-md-6"&gt;
                                  &lt;input id="password-confirm" type="password" class="form-control" name="password_confirmation" required&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group row mb-0"&gt;
                              &lt;div class="col-md-6 offset-md-4"&gt;
                                  &lt;button type="submit" class="btn btn-primary"&gt;
                                      {{ __('Register') }}
                                  &lt;/button&gt;
                                  &lt;a href="{{url('auth/google')}}" class="btn btn-primary"&gt;Register With Google&lt;/a&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  @endsection
  </code></pre>
  
  <p>Model is User and its code is given below.</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Contracts\Auth\MustVerifyEmail;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'tname','fname','domicile','nic','phone','email','off_email', 'password'
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  }
  </code></pre>
  
  <p>This is the code of auth/RegisterController.php</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\User;
  use App\Http\Controllers\Controller;
  use Illuminate\Support\Facades\Hash;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Foundation\Auth\RegistersUsers;
  
  class RegisterController extends Controller
  {
      /*
      |--------------------------------------------------------------------------
      | Register Controller
      |--------------------------------------------------------------------------
      |
      | This controller handles the registration of new users as well as their
      | validation and creation. By default this controller uses a trait to
      | provide this functionality without requiring any additional code.
      |
      */
  
      use RegistersUsers;
  
      /**
       * Where to redirect users after registration.
       *
       * @var string
       */
      protected $redirectTo = '/home';
  
      /**
       * Create a new controller instance.
       *
       * @return void
       */
      public function __construct()
      {
          $this-&gt;middleware('guest');
      }
  
      /**
       * Get a validator for an incoming registration request.
       *
       * @param  array  $data
       * @return \Illuminate\Contracts\Validation\Validator
       */
      protected function validator(array $data)
      {
          return Validator::make($data, [
              'tname' =&gt; 'required|string|max:255',
              'fname' =&gt; 'required|string|max:255',
              'domicile' =&gt; 'required|string|max:255',
              'nic' =&gt; 'required|string|max:255',
              'phone' =&gt; 'required|string|max:255',
              'email' =&gt; 'required|string|email|max:255|unique:users',
              'off_email' =&gt; 'required|string|email|max:255',
              'password' =&gt; 'required|string|min:6|confirmed',
          ]);
      }
  
      /**
       * Create a new user instance after a valid registration.
       *
       * @param  array  $data
       * @return \App\User
       */
      protected function create(array $data)
      {
          return User::create([
              'tname' =&gt; $data['tname'],
              'fname' =&gt; $data['fname'],
              'domicile' =&gt; $data['domicile'],
              'nic' =&gt; $data['nic'],
              'phone' =&gt; $data['phone'],
              'email' =&gt; $data['email'],
              'off_email' =&gt; $data['off_email'],
              'password' =&gt; Hash::make($data['password']),
          ]);
      }
  }
  </code></pre>
  
  <p>The form does not showing any error while submiting it is just refreshing, no message that data is inserted or not, while when i check users table there will no any row,..Any body can help me please, </p>