/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function update(Client $table, Request $request, $id) { $table->validate($request, $table->rules()); $table = $table->find($id); foreach (\Input::except('_token', '_method', 'client_logo') as $k => $v) { if (is_array($v)) { $v = json_encode($v); } $table->{$k} = $v; } $table->save(); if ($request->hasFile('client_logo')) { $table->uploadFile($request->file("client_logo"), $id); } $notification[] = array('type' => 'success', 'message' => \Lang::get('notification.edit_success')); \Session::flash('notification', $notification); return redirect('client'); }