title: laravel form, data not storing into the database
body: <p>this is my blade file
  
  @csrf
  
  name
  
  @if ($errors-&gt;has('name'))
  {{ $errors-&gt;first('name') }}
  @endif
  </p>
  <pre><code>                    &lt;div class=&quot;form-group col-md-6&quot;&gt;
                          &lt;label&gt;email&lt;/label&gt;
                          &lt;input type=&quot;email&quot; name=&quot;email&quot; class=&quot;form-control&quot; id=&quot;email&quot; placeholder=&quot;Enter your email&quot; required autofocus&gt;
                          @if ($errors-&gt;has('email'))
                              &lt;span class=&quot;Enter properly&quot;&gt;{{ $errors-&gt;first('email') }}&lt;/span&gt;
                          @endif
                      &lt;/div&gt;
  
                      &lt;div class=&quot;form-group col-md-6&quot;&gt;
                          &lt;label&gt;Mobile-no&lt;/label&gt;
                          &lt;input type=&quot;text&quot; name=&quot;mobile-no&quot; class=&quot;form-control&quot; id=&quot;mobile_no&quot; placeholder=&quot;Enter your mobile no&quot; required&gt;
                          @if ($errors-&gt;has('mobile-no'))
                              &lt;span class=&quot;Enter 10digits&quot;&gt;{{ $errors-&gt;first('mobile_no') }}&lt;/span&gt;
                          @endif
                      &lt;/div&gt;
  
                      &lt;div class=&quot;form-group col-md-6&quot;&gt;
                          &lt;label&gt;Password&lt;/label&gt;
                          &lt;input type=&quot;password&quot; name=&quot;password&quot; class=&quot;form-control&quot; id=&quot;password&quot; placeholder=&quot;Enter your password&quot; required&gt;
                          @if ($errors-&gt;has('password'))
                              &lt;span class=&quot;Enter properly&quot;&gt;{{ $errors-&gt;first('password') }}&lt;/span&gt;
                          @endif
                      &lt;/div&gt;
  
                      &lt;div class=&quot;form-group col-md-6&quot;&gt;
                          &lt;label&gt;Confirm-password&lt;/label&gt;
                          &lt;input type=&quot;password&quot; name=&quot;confirm_password&quot; class=&quot;form-control&quot; id=&quot;confirm_password&quot; placeholder=&quot;Re-enter your password&quot; &gt;
                      &lt;/div&gt;
  
                      &lt;div class=&quot;form-group col-md-6&quot; align=&quot;center&quot;&gt;
                          &lt;button class=&quot;btn btn-success&quot; style=&quot;width:80px;&quot;&gt;Submit&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  
  
          &lt;/form&gt;
  @endsection
  </code></pre>
  <p>This is my controller file</p>
  <pre><code>&lt;?php
      
      namespace App\Http\Controllers;
      
      use App\Http\Controllers\FormController;
      use Illuminate\Http\Request;
      use Hash;
      use Session;
      use App\Models\User;
      use Illuminate\Support\Facades;
      
      class FormController extends Controller
      {
      
          public function index()
          {
              return view ('login');
          }
      
          public function postLogin(Request $request)
          {
              $request-&gt;validate([
                  'email' =&gt; 'required',
                  'password' =&gt; 'required',
              ]);
          
              $credentials = $request-&gt;only('email', 'password');
              if (User::attempt($credentials)) {
                  return redirect()-&gt;intended('dashboard')
                              -&gt;withSuccess('Signed in');
              }
         
              return redirect(&quot;login&quot;)-&gt;withSuccess('Login details are not valid');
          }
      
          public function registration()
          {
              return view('registration');
          }
          public function postRegistration(Request $request)
          {
              $request-&gt;validate([
                  'name' =&gt; 'required',
                  'email' =&gt; 'required',
                  'mobile_no' =&gt; 'required',
                  'password' =&gt; 'required|min:6',
                  'confirm_password' =&gt; 'required', 
              ]);
      
              $data = $request-&gt;all();
              $check = $this-&gt;create($data);
                
              return redirect(&quot;dashboard&quot;)-&gt;withSuccess('have signed-in');
      
           }
      
           public function create(array $data)
           {
             return User::create([
               'name' =&gt; $data['name'],
               'email' =&gt; $data['email'],
               'password' =&gt; Hash::make($data['password'])
             ]);
           }    
      
           public function dashboard()
          {
              if(User::check()){
                  return view('dashboard');
              }
         
              return redirect(&quot;login&quot;)-&gt;withSuccess('are not allowed to access');
      
          }
          public function signOut()
          {
              Session::flush();
              User::logout();
         
              return Redirect('login');
          }
      
      }
  </code></pre>
  <p>//this is my route file</p>
  <pre><code>Route::get('dashboard', [FormController::class, 'dashboard']);
  Route::get('login', [FormController::class, 'index'])-&gt;name('login');
  Route::post('post-login', [FormController::class, 'postLogin'])-&gt;name('login.post');
  Route::get('registration', [FormController::class, 'registration'])-&gt;name('register');
  Route::post('post-registration', [FormController::class, 'postRegistration'])-&gt;name('register.post');
  </code></pre>
  <p>//this  is my migration</p>
  <pre><code>&lt;?php
  
  use Illuminate\Database\Migrations\Migration;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Support\Facades\Schema;
  
  return new class extends Migration
  {
      public function up()
      {
          Schema::create('customRegistration', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;integer('user_id');
              $table-&gt;string('name');
              $table-&gt;string('email');
              $table-&gt;integer('mobile_no');
              $table-&gt;string('password');
              $table-&gt;string('confirm_password');
              $table-&gt;timestamps();
          });
      }
      public function down()
      {
          Schema::drop('form');
      }
  }
  </code></pre>
  <p>i created simple laravel login &amp; registration form.laravel is not genrating errors. but it is not stored a data into the database i.e any of data will be not stored in database.</p>