/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(CustomerRequest $request, $id)
 {
     $customer = Customer::findOrFail($id);
     $customer->update($request->all());
     return redirect('customers');
 }
示例#2
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(CustomerRequest $request)
 {
     $input = $request->all();
     Customer::create($input);
     return redirect('customer');
 }
示例#3
0
 /**
  * Update the specified resource in storage.
  *
  * @param CustomerRequest $request
  * @param int             $id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(CustomerRequest $request, $id)
 {
     $this->saveCustomer($request->all(), $id);
     return redirect()->route('admin.customers.index');
 }
 /**
  * Store a new customer
  */
 public function store(CustomerRequest $request)
 {
     $customer = Customer::create($request->all());
     logThis('Customer Added: ' . $customer->name . ' was added.');
     return $customer;
 }
示例#5
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CustomerRequest $request)
 {
     $customer = Customer::create($request->all());
     return redirect('customers');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(CustomerRequest $request, $id)
 {
     if (Customer::find($id)->update($request->all())) {
         return redirect('/customer')->with('succcess', 'Sukses ubah customer.');
     }
     return redirect()->back()->withErrors(['failed' => 'Gagal ubah customer.']);
 }
示例#7
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(CustomerRequest $request, $id)
 {
     $customer = Customer::findOrFail($id);
     $customer->update($request->all());
     return redirect('customer')->with('message', 'Data berhasil dirubah!');
 }