app/Http/Controllers/SiswaController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Siswa  $siswa
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Siswa $siswa)
    {
        $request->validate([
            'nis' => 'required',
            'nama' => 'required',
            'jk' => 'required',
            'tempat_lahir' => 'required',
            'tanggal_lahir' => 'required',
            'alamat' => 'required',
            'asal_sekolah' => 'required',
            'kelas' => 'required',
            'jurusan' => 'required',
        ]);
        $siswa->update($request->all());
        return redirect()->route('siswas.index')
                        ->with('success','Siswa updated successfully');
    }
public function update ( Request $ request , Siswa $ siswa ) { $ request -> validate ( [ 'nis' => 'required' , 'nama' => 'required' , 'jk' => 'required' , 'tempat_lahir' => 'required' , 'tanggal_lahir' => 'required' , 'alamat' => 'required' , 'asal_sekolah' => 'required' , 'kelas' => 'required' , 'jurusan' => 'required' , ] ) ; $ siswa -> update ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'siswas.index' ) -> with ( 'success' , 'Siswa updated successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .