Skip to content

Instantly share code, notes, and snippets.

@rbezerra
Created October 20, 2016 20:29
Show Gist options
  • Select an option

  • Save rbezerra/314f5a53f9dd4a5833c97287803bf3d2 to your computer and use it in GitHub Desktop.

Select an option

Save rbezerra/314f5a53f9dd4a5833c97287803bf3d2 to your computer and use it in GitHub Desktop.
DB::beginTransaction();
try{
$endereco_array = array(
'cep' => $request->input('cep'),
'logradouro' => $request->input('logradouro_endereco'),
'bairro' => $request->input('bairro_endereco'),
'cidade' => $request->input('cidade_endereco'),
'uf' => $request->input('uf_endereco'),
'numero' => $request->input('numero_endereco'),
'complemento' => $request->input('complemento_endereco')
);
//dd($endereco_array);
$endereco = GusEndereco::create($endereco_array);
}catch(\Exception $e){
DB::rollback();
dd($e);
return \Redirect::back()
->withErrors($e->getMessage())
->withInput($request->all());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment