app/Http/Controllers/UsuariosController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create(Request $request)
    {
        $personas = Personas::create([
              'per_nombre' => $request->input('nombre'),
              'per_apellido' =>  $request->input('apellido'),
              'per_ci' => $request->input('documento'),
              'per_telefono' => $request->input('telefono'),
            ]);
        $tipousuario = $request->input('TUS');
        if ($tipousuario == 6){
            $usuarios = User::create([
                  'email' => $request->input('email'),
                  'password' =>  bcrypt($request->input('contrasena')), 
                  'usu_tipo_rec_id' => $request->input('TUS'),
                  'usu_status_rec_id' => 2,
                  'usu_per_id' => $personas->per_id,
                ]);
        }else{
            if ($tipousuario == 501){
                $usuarios = User::create([
                      'email' => $request->input('email'),
                      'password' =>  bcrypt($request->input('contrasena')), 
                      'usu_tipo_rec_id' => $request->input('TUS'),
                      'usu_status_rec_id' => 499,
                      'usu_per_id' => $personas->per_id,
                    ]);
            }            
        }
        return view('login.login');
    }
public function create ( Request $ request ) { $ personas = Personas :: create ( [ 'per_nombre' => $ request -> input ( 'nombre' ) , 'per_apellido' => $ request -> input ( 'apellido' ) , 'per_ci' => $ request -> input ( 'documento' ) , 'per_telefono' => $ request -> input ( 'telefono' ) , ] ) ; $ tipousuario = $ request -> input ( 'TUS' ) ; if ( $ tipousuario == 6 ) { $ usuarios = User :: create ( [ 'email' => $ request -> input ( 'email' ) , 'password' => bcrypt ( $ request -> input ( 'contrasena' ) ) , 'usu_tipo_rec_id' => $ request -> input ( 'TUS' ) , 'usu_status_rec_id' => 2 , 'usu_per_id' => $ personas -> per_id , ] ) ; } else { if ( $ tipousuario == 501 ) { $ usuarios = User :: create ( [ 'email' => $ request -> input ( 'email' ) , 'password' => bcrypt ( $ request -> input ( 'contrasena' ) ) , 'usu_tipo_rec_id' => $ request -> input ( 'TUS' ) , 'usu_status_rec_id' => 499 , 'usu_per_id' => $ personas -> per_id , ] ) ; } } return view ( 'login.login' ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .