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, Customer $customer)
    {
        $data = request()->validate([
            'nama' => 'required|string|max:120',
            'no_telepon' => 'required|string|max:20',
            'address' => 'required|string|max:190',
        ]);
        $customer->update($data);
        return redirect()->route('customer.index')->with('success', 'Data Customer '.$customer->nama.' berhasil diubah');
    }
public function update ( Request $ request , Customer $ customer ) { $ data = request ( ) -> validate ( [ 'nama' => 'required|string|max:120' , 'no_telepon' => 'required|string|max:20' , 'address' => 'required|string|max:190' , ] ) ; $ customer -> update ( $ data ) ; return redirect ( ) -> route ( 'customer.index' ) -> with ( 'success' , 'Data Customer ' . $ customer -> nama . ' berhasil diubah' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .