Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $data = $request->all();
- if( $data ) {
- $user = new User;
- $user->nome = $data['name'];
- $user->email = $data['email'];
- $user->permission = 'anunciante';
- $user->password= bcrypt( $data['password']);
- $anunciante = new Anunciante;
- $anunciante->nomeFantasia = $data['name'];
- $anunciante->razaoSocial = $data['razao'];
- $anunciante->cnpj = $data['CNPJ'];
- $anunciante->email = $data['email'];
- $anunciante->telefone = $data['telefone'];
- $anunciante->password= bcrypt( $data['password']);
- $auth = [
- 'email' => $data['email'],
- 'password' => $data['password']
- ];
- if( Auth::attempt($auth) ) {
- return redirect('anunciante/home');
- } else {
- return redirect('anunciante/login');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement