app/Http/Controllers/PemaganganController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Pemagangan $pemagang)
    {
        $validate = $request->validate([
            'mahasiswa_id' => 'required',
            'dosenpembimbing_id' => 'required',
            'dosenpembimbing2_id' => 'required',
            'pembimbingindustri_id' => 'required',
            'mulai_magang' => 'required|date',
            'selesai_magang' => 'required|date',
            'laporan_weekend' => 'required|numeric'
        ]);
        $nama = $pemagang->mahasiswa->nama;
        $pemagang->update($validate);
        return redirect('/pemagangan')->with('sukses',"Pemagangan $nama berhasil diperbarui.");
    }
public function update ( Request $ request , Pemagangan $ pemagang ) { $ validate = $ request -> validate ( [ 'mahasiswa_id' => 'required' , 'dosenpembimbing_id' => 'required' , 'dosenpembimbing2_id' => 'required' , 'pembimbingindustri_id' => 'required' , 'mulai_magang' => 'required|date' , 'selesai_magang' => 'required|date' , 'laporan_weekend' => 'required|numeric' ] ) ; $ nama = $ pemagang -> mahasiswa -> nama ; $ pemagang -> update ( $ validate ) ; return redirect ( '/pemagangan' ) -> with ( 'sukses' , " Pemagangan  $ nama  berhasil diperbarui. " ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// dd($validate);