Level 44
Hi , in first place that merge doens´t make any sense in my opinion, second the only line that would allow you to insert record on database is commented.
Do you have a Client model ? if so do this way
public function store(Request $request)
{
$cliente = Client::create([
'name_for_example' => request()->input('name'),
'email_for_example' => request()->input('email'),
'password_for_example' => bcrypt(request()->input('password'))
]);
// Or You can do
$cliente = new Client;
$client->name_for_example = request()->input('name');
$client->email_for_example = request()->input('email');
$client->password_for_example = request()->input('password');
if($cliente){
$mensagem = array(
'type' => 'success',
'retorno' => 'Cliente cadastrado com sucesso'
);
}else{
$mensagem = array(
'type' => 'error',
'retorno' => 'Erro ao salvar'
);
}
return redirect()->route('site.acesso')
->with('status', $mensagem['type'])
->with('retornomensagem', $mensagem['retorno']);
}
1 like