app/Http/Controllers/HistoryKendaraanController.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, $platnomer)
    {
        $request->validate([
            'platnomer' => 'required',
            'jenis_kendaraan' => 'required',
            'laka_kecelakaan' => 'required',
            'pelanggaran' => 'required',
            'tanggal_kejadian' => 'required',
            'tempat_kejadian' => 'required',
        ]);
        HistoryKendaraan::find($platnomer)->update($request->all());
        return redirect()->route('HistoryKendaraan.index')
            ->with('success', 'History Kendaraan Berhasil Diupdate');
    }
public function update ( Request $ request , $ platnomer ) { $ request -> validate ( [ 'platnomer' => 'required' , 'jenis_kendaraan' => 'required' , 'laka_kecelakaan' => 'required' , 'pelanggaran' => 'required' , 'tanggal_kejadian' => 'required' , 'tempat_kejadian' => 'required' , ] ) ; HistoryKendaraan :: find ( $ platnomer ) -> update ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'HistoryKendaraan.index' ) -> with ( 'success' , 'History Kendaraan Berhasil Diupdate' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .