/** * Store a newly created resource in storage. * * @return Response */ public function store(\App\Http\Requests\ClientesRequest $request) { $input = $request->all(); $input['idMecanica'] = Session::get('admin')->id; Clientes::create($input); //return redirect()->route('usuarios.index', ['user' => 1]); return Redirect::route('clientes.index', ['create' => true]); }
public function update(ClientesRequest $request, $id) { $cliente = Clientes::find($id)->update($request->all()); return redirect()->route('clientes'); }
public function update(Client $client, ClientesRequest $request, $id) { $client = Client::findOrFail($id); $client->update($request->all()); return redirect('clientes'); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(ClientesRequest $request, $id) { $cliente = Cliente::find($id); $cliente->update($request->all()); if ($request->contato) { $this->insertContatos($request->contato, $cliente); } if ($request->endereco) { $this->insertEnderecos($request->endereco, $cliente); } flash()->success('Cliente atualizado com sucesso'); return redirect('/clientes'); }