title: Too few arguments to function App\Http\Controllers\DataPegawaiController::storeDetail(), 1 passed in
body: <p>i have problem like this. After insert new User to Pegawais table, i want to redirect to another view with user id parameter to define EducationHistory &amp; WorkExperience data.
  but when i</p>
  <p>Too few arguments to function App\Http\Controllers\DataPegawaiController::storeDetail(), 1 passed in C:\xampp\htdocs\data-pegawai\vendor\laravel\framework\src\Illuminate\Routing\Controller.php on line 54 and exactly 2 expected</p>
  <p>show method is where i fill my form to insert onto storeDetails method which is use user id parameter from show method route.</p>
  <pre><code>public function show($id)
  {
  
      $user = User::find($id);
      
      return view('pegawai.create-details',['user'=&gt;$user]);
  }
  
  public function storeDetail($id,Request $request)
  {
      $user = new User;
      $user-&gt;id_pegawai;
      
      dd($user);
      
      $pendidikanAttribute = [];
      $pendidikanAttribute['nama_sekolah'] = $request-&gt;nama_sekolah;
      $pendidikanAttribute['jurusan'] = $request-&gt;jurusan;
      $pendidikanAttribute['tahun_masuk'] = $request-&gt;tahun_masuk;
      $pendidikanAttribute['tahun_lulus'] = $request-&gt;tahun_lulus;
      $pendidikanAttribute['id_pegawai'] = $user-&gt;id_pegawai;;
  
      Pendidikan::create($pendidikanAttribute);
  
      $pengalamanAttribute = [];
      $pengalamanAttribute['perusahaan'] = $request-&gt;perusahaan;
      $pengalamanAttribute['jabatan'] = $request-&gt;jabatan;
      $pengalamanAttribute['tahun'] = $request-&gt;tahun;
      $pengalamanAttribute['keterangan'] = $request-&gt;keterangan;
      $pendidikanAttribute['id_pegawai'] = $user-&gt;id_pegawai;;
  
      PengalamanKerja::create($pengalamanAttribute);
  
      return redirect()-&gt;route('data-pegawai.index');
  }
  </code></pre>
  <p>and this is my store detail view code :</p>
  <pre><code>&lt;form method=&quot;POST&quot; class=&quot;mt-4&quot; action=&quot;{{route('data-pegawai.storeDetail',$user-&gt;id_pegawai)}}&quot;&gt;
                          @csrf
  </code></pre>
  <p>this is my route :</p>
  <pre><code>Route::post('/data-pegawai/{id}/store-detail/', [DataPegawaiController::class,'storeDetail'])-&gt;name('data-pegawai.storeDetail');
  </code></pre>