app/Http/Controllers/MasterController.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, $id)
    {
        $messages = [
            'required' => 'Kolom :attribute tidak boleh kosong!',
            'date' => 'Kolom :attribute harus berupa tanggal!',
            'numeric' => 'Kolom :attribute harus berupa angka!'
        ];
        $validasi =$request->validate([
            'nama' =>'required',
            'jenis' => 'required'
        ],$messages);
        Dokumen::whereid($id)->update($validasi);
        return redirect('/')->with('success', 'Data berhasil diupdate!');
    }
public function update ( Request $ request , $ id ) { $ messages = [ 'required' => 'Kolom :attribute tidak boleh kosong!' , 'date' => 'Kolom :attribute harus berupa tanggal!' , 'numeric' => 'Kolom :attribute harus berupa angka!' ] ; $ validasi = $ request -> validate ( [ 'nama' => 'required' , 'jenis' => 'required' ] , $ messages ) ; Dokumen :: whereid ( $ id ) -> update ( $ validasi ) ; return redirect ( '/' ) -> with ( 'success' , 'Data berhasil diupdate!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .