title: Laravel Eloquent cannot insert to database
body: <p>I'm making an app that runs like google form using Laravel 5.7. Here is the form table that i already made:</p>
  
  <p><a href="https://i.stack.imgur.com/sg3SN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sg3SN.jpg" alt="1st page"></a>
  <a href="https://i.stack.imgur.com/aaSy3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aaSy3.jpg" alt="2nd page"></a> 
  I made an eloquent model so that each Name in Personal details table has one record that contains all these table and insert filled table into database after click submit button. The problem is, it didn't successfully inserted into database. I don't know what's the problem, here are my codes:</p>
  
  <p><strong>PersonalDetails.php (eloquent model)</strong>
      
  
  <pre><code>namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class PersonalDetails extends Model
  {
      protected $table = 'personal_details';
      protected $guarded = ['id'];
  
  public function accomodation()
  {
      return $this-&gt;hasOne('App\Accomodation');
  }
  
  public function course()
  {
      return $this-&gt;hasOne('App\Course');
  }
  
  public function proposedStudy()
  {
      return $this-&gt;hasOne('App\ProposedStudy');
  }
  
  public function emergencyContact()
  {
      return $this-&gt;hasOne('App\EmergencyContact');
  }
  
  public function englishTestResult()
  {
      return $this-&gt;hasOne('App\EnglishTestResult');
  }
  
  public function homeInstitution()
  {
      return $this-&gt;hasOne('App\HomeInstitution');
  }
  
  public function insurance()
  {
      return $this-&gt;hasOne('App\Insurance');
  }
  }
  </code></pre>
  
  <p><strong>FormController.php</strong></p>
  
  <pre><code>public function submit(Request $request) {
  
      $request-&gt;validate([
          // Personal Details
          'fullname' =&gt; 'required|string',
          'nationality' =&gt; 'required|string',
          'date_of_birth' =&gt; 'required|string',
          'passport_number' =&gt; 'required|string',
          'issuing_country' =&gt; 'required|string',
          'date_of_issue' =&gt; 'required|string',
          'date_of_expiry' =&gt; 'required|string',
          'blood_type' =&gt; 'required|string',
          'marital_status' =&gt; 'required|string',
          'address' =&gt; 'required|string',
          'city' =&gt; 'required|string',
          'postal_code' =&gt; 'required|numeric',
          'province' =&gt; 'required|string',
          'country' =&gt; 'required|string',
          'phone' =&gt; 'required|string',
          'mobile' =&gt; 'required|string',
          'email' =&gt; 'required|email',
          'address2' =&gt; 'nullable|text',
          'city2' =&gt; 'nullable|string',
          'postal_code2' =&gt; 'nullable|numeric',
          'province2' =&gt; 'nullable|string',
          'country2' =&gt; 'nullable|string',
          'phone2' =&gt; 'nullable|string',
          'contact_name' =&gt; 'required|string',
  
          // Home Institution
          'name' =&gt; 'required|string',
          'address' =&gt; 'required|string',
          'phone' =&gt; 'required|string',
          'email' =&gt; 'required|email',
          'website' =&gt; 'required|string',
          'faculty_dep' =&gt; 'required|string',
          'start_year' =&gt; 'required|string',
          'gpa' =&gt; 'required|string',
  
          // Proposed Study
          'semester' =&gt; 'required|in:Semester I (Aug-Jan),Semester II (Feb-Jun)',
          'academic_year' =&gt; 'required|string',
          'faculty' =&gt; 'required|string',
          'department' =&gt; 'required|string',
          'study_period' =&gt; 'required|string',
          'start_date' =&gt; 'required|string',
          'end_date' =&gt; 'required|string',
          // Course
          'course_title' =&gt; 'required|string',
          'credit' =&gt; 'required|string',
  
          // English Test Result
          'test' =&gt; 'required|string',
          'score' =&gt; 'required|numeric',
          'test_center' =&gt; 'required|string',  
          'date_tested' =&gt; 'required|string',
  
          // Insurance
          'insurance_name' =&gt; 'required|string',
          'validity' =&gt; 'required|string',
          'cover' =&gt; 'required|string',
  
          // Accomodation
          'accomodation_help' =&gt; 'required|in:YES,NO',
          'adress' =&gt; 'required|string',
          'contact_person' =&gt; 'required|string',
  
          // Contact of Emergency
          'fullname' =&gt; 'required|string',
          'relationship' =&gt; 'required|string',
          'address' =&gt; 'required|string',
          'phone' =&gt; 'required|string',
          'mobile' =&gt; 'required|string',
          'email' =&gt; 'required|email',
  
  
      ]);
  
      PersonalDetails::create([
          'fullname' =&gt; $request-&gt;input('name'),
          'nationality' =&gt; $request-&gt;input('nationality'),
          'date_of_birth' =&gt; $request-&gt;input('dob'),
          'passport_number' =&gt; $request-&gt;input('passport'),
          'issuing_country' =&gt; $request-&gt;input('is_country'),
          'date_of_issue' =&gt; $request-&gt;input('doi'),
          'date_of_expiry' =&gt; $request-&gt;input('doe'),
          'blood_type' =&gt; $request-&gt;input('blood'),
          'marital_status' =&gt; $request-&gt;input('maritial'),
          'address' =&gt; $request-&gt;input('address'),
          'city' =&gt; $request-&gt;input('city'),
          'postal_code' =&gt; $request-&gt;input('postal'),
          'province' =&gt; $request-&gt;input('state'),
          'country' =&gt; $request-&gt;input('country'),
          'phone' =&gt; $request-&gt;input('phone'),
          'mobile' =&gt; $request-&gt;input('mobile'),
          'email' =&gt; $request-&gt;input('email'),
          'address2' =&gt; $request-&gt;input('address2'),
          'city2' =&gt; $request-&gt;input('city2'),
          'postal_code2' =&gt; $request-&gt;input('postal2'),
          'province2' =&gt; $request-&gt;input('state2'),
          'country2' =&gt; $request-&gt;input('country2'),
          'phone2' =&gt; $request-&gt;input('phone2'),
          'contact_name' =&gt; $request-&gt;input('contact_name'),
      ]);
  
      HomeInstitution::create([
          'name' =&gt;  $request-&gt;input('institution'),
          'address' =&gt;  $request-&gt;input('i_address'),
          'phone' =&gt;  $request-&gt;input('i_phone'),
          'email' =&gt;  $request-&gt;input('i_email'),
          'website' =&gt;  $request-&gt;input('web'),
          'faculty_dep' =&gt;  $request-&gt;input('faculty_dept'),
          'start_year' =&gt;  $request-&gt;input('s_year'),
          'gpa' =&gt;  $request-&gt;input('gpa'),
      ]);
  
      ProposedStudy::create([
          'semester' =&gt; $request-&gt;input('duration'),
          'academic_year' =&gt; $request-&gt;input('f_year') . '/' . $request-&gt;input('l_year'),
          'faculty' =&gt; $request-&gt;input('faculty'),
          'department' =&gt; $request-&gt;input('department'),
          'study_period' =&gt; $request-&gt;input('spesific_period'),
          'start_date' =&gt; $request-&gt;input('start_date'),
          'end_date' =&gt; $request-&gt;input('end_date'),
      ]);
  
      Course::create([
          'course_title' =&gt; $request-&gt;input('course_1'),
          'credit' =&gt; $request-&gt;input('credit_1'),
      ]);
  
      EnglishTestResult::create([
          'test' =&gt; $request-&gt;input('toefl'),
          'score' =&gt; $request-&gt;input('score_toefl'),
          'test_center' =&gt; $request-&gt;input('place_toefl'),     
          'date_tested' =&gt; $request-&gt;input('date_toefl'),
      ]);
  
      Insurance::create([
          'insurance_name' =&gt; $request-&gt;input('insurance'),
          'validity' =&gt; $request-&gt;input('valid_date'),
          'cover' =&gt; $request-&gt;input('cover'),
      ]);
  
      Accomodation::create([
          'accomodation_help' =&gt; $request-&gt;input('opt_acc'),
          'adress' =&gt; $request-&gt;input('adress_acc'),
          'contact_person' =&gt; $request-&gt;input('cp_acc'),
      ]);
  
      EmergencyContact::create([
          'fullname' =&gt; $request-&gt;input('emergency_name'),
          'relationship' =&gt; $request-&gt;input('relationship'),
          'address' =&gt; $request-&gt;input('address_emergency'),
          'phone' =&gt; $request-&gt;input('emergency_phone'),
          'mobile' =&gt; $request-&gt;input('emergency_mobile'),
          'email' =&gt; $request-&gt;input('emergency_email'),
      ]);
  
      // return back()-&gt; with('success', 'Berhasil submit!');
  }
  </code></pre>