1 year ago

Laravel + wordpress connection

Posted 1 year ago by goncalolopes

My use ase: I have a laravel backend with laraadmin for users menage tehir info and etc. But now i need to create a wordpress shop(its a prerequisite). When a user register (laravel side) laravel need to create the same user in laravel shop for the user use the same login in both sites. Any sugestions? My approach was with sql queries like

  $teste = DB::connection('wordpress')->table('wp_users')->insert(['user_login'=>$event->request["utilizador_mail"],
        'user_nicename' => $event->request["utilizador_nome"],
        'display_name' => $event->request["utilizador_nome"],
        'user_email' => $event->request["utilizador_mail"],
        'user_pass' => bcrypt($event->request["utilizador_password"]), 
        "user_registered" => \Carbon\Carbon::now(), 

Please sign in or create an account to participate in this conversation.