app/Http/Controllers/SiswaController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Siswa  $siswa
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Siswa $sisw)
    {
        $request->validate([
            'nisn' => 'required',
            'nama' => 'required',
            'tempatlahir' => 'required',
            'tanggallahir'=>'required',
            'jeniskelamin'=>'required',
            'agama'=>'required',
            'kelas'=>'required',
            'alamat'=>'required',
            'orangtua'=>'required',
        ]);
        $sisw->update($request->all());
        return redirect()->route('sisw.index')->with('succes','Siswa Berhasil di Update');
    }
public function update ( Request $ request , Siswa $ sisw ) { $ request -> validate ( [ 'nisn' => 'required' , 'nama' => 'required' , 'tempatlahir' => 'required' , 'tanggallahir' => 'required' , 'jeniskelamin' => 'required' , 'agama' => 'required' , 'kelas' => 'required' , 'alamat' => 'required' , 'orangtua' => 'required' , ] ) ; $ sisw -> update ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'sisw.index' ) -> with ( 'succes' , 'Siswa Berhasil di Update' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .