app/Http/Controllers/BuyerBankController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\BuyerBank  $buyerBank
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $request->validate([
            'name' => 'required',
            'branch_add' => 'required',
            'swift_code' => 'required'
        ]);
        $buyerBank = BuyerBank::find($id);
        $buyerBank->name = $request->get('name');
        $buyerBank->branch_add = $request->get('branch_add');
        $buyerBank->swift_code = $request->get('swift_code');
        $buyerBank->save();
        return redirect()->route('buyerBank.index')
            ->with('success', 'buyerBank Updated Successfully');
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'name' => 'required' , 'branch_add' => 'required' , 'swift_code' => 'required' ] ) ; $ buyerBank = BuyerBank :: find ( $ id ) ; $ buyerBank -> name = $ request -> get ( 'name' ) ; $ buyerBank -> branch_add = $ request -> get ( 'branch_add' ) ; $ buyerBank -> swift_code = $ request -> get ( 'swift_code' ) ; $ buyerBank -> save ( ) ; return redirect ( ) -> route ( 'buyerBank.index' ) -> with ( 'success' , 'buyerBank Updated Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .