title: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (unfix)
body: <p>I am using laravel</p>
  <p><strong>My Error:</strong></p>
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`bd_name`.`inpatients`, CONSTRAINT `inpatients_ward_id_foreign` FOREIGN KEY (`ward_id`) REFERENCES `wards` (`id`)) (SQL: insert into `inpatients` (`patient_id`, `ward_id`, `updated_at`, `created_at`) values (2010101, 06, 2020-10-14 06:44:12, 2020-10-14 06:44:12))
  </code></pre>
  <p><strong>My inpatient table is here:</strong></p>
  <pre><code>$table-&gt;bigIncrements('id');
  $table-&gt;timestamps();
  $table-&gt;unsignedBigInteger('patient_id');
  $table-&gt;foreign('patient_id')-&gt;references('id')-&gt;on('patients');
  $table-&gt;char('discharged',4)-&gt;default('NO'); // YES | NO
  $table-&gt;unsignedBigInteger('ward_id');
  $table-&gt;foreign('ward_id')-&gt;references('id')-&gt;on('wards');
  </code></pre>
  <p><strong>inpatientController</strong></p>
  <pre><code>$INPtable = new inpatient;
  $INPtable-&gt;patient_id = $request-&gt;reg_pid;
  $INPtable-&gt;ward_id = $request-&gt;reg_ipwardno;
  </code></pre>
  <p><strong>Inpatient Model</strong></p>
  <pre><code>protected $fillable = [
  'ward_id','patient_id',
  ];
  
  public function ward() {
      return $this-&gt;belongsTo('App\Ward');
  }
  
  public function patient() {
      return $this-&gt;belongsTo('App\Patients');
  }
  </code></pre>
  <p>I don't understand what's going wrong here. Please help me.</p>