app/Http/Controllers/MemberController.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)
    {
        $request->validate([
            'nama' => 'required|string|max:255',
            'no_hp' => 'required|numeric',
        ]);
        $member = Member::find($id);
        $member->nama = $request->nama;
        $member->no_hp = $request->no_hp;
        $member->save();
        return redirect()->route('member.index')->with('info', 'Data member berhasil diupdate');
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'nama' => 'required|string|max:255' , 'no_hp' => 'required|numeric' , ] ) ; $ member = Member :: find ( $ id ) ; $ member -> nama = $ request -> nama ; $ member -> no_hp = $ request -> no_hp ; $ member -> save ( ) ; return redirect ( ) -> route ( 'member.index' ) -> with ( 'info' , 'Data member berhasil diupdate' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .