app/Http/Controllers/CustomerController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Customer  $customer
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request,$id)
    {
        $customer = Customer::find($id);
        $customer->firstname = $request->input('firstname');
        $customer->lastname = $request->input('lastname');
        $customer->email = $request->input('email');
        $customer->address = $request->input('address');
        $customer->trn_number = $request->input('trn_number');
        $customer->id_type = $request->input('id_type');
        $customer->id_number = $request->input('id_number');
        $customer->save();
        return redirect()->route('customers.index');
    }
public function update ( Request $ request , $ id ) { $ customer = Customer :: find ( $ id ) ; $ customer -> firstname = $ request -> input ( 'firstname' ) ; $ customer -> lastname = $ request -> input ( 'lastname' ) ; $ customer -> email = $ request -> input ( 'email' ) ; $ customer -> address = $ request -> input ( 'address' ) ; $ customer -> trn_number = $ request -> input ( 'trn_number' ) ; $ customer -> id_type = $ request -> input ( 'id_type' ) ; $ customer -> id_number = $ request -> input ( 'id_number' ) ; $ customer -> save ( ) ; return redirect ( ) -> route ( 'customers.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .