Maybe you duplicate the wordpress database to you laravel or vice versa, and than reset everyone password, so they just need to change it, and add a kind of register in both database when new users comes.
Pretty easy quick fix.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey all I am having a tough time I found literally what my question was here is a quote from a previous post Pretty much I have a woocommerce store with subs etc and creating a dashboard for services purchased so they can access what they've purchased.
"We are using WordPress as our store (using woocommerce). our backend use laravel where users who bought our services can use and manage the services they bought from us. we will eventually move to custom implementation of our store in laravel but right now we don't want to break anything. what i want is to integrate wordpress and laravels login so they don't have to login or register twice. something like github use (if you login at github you are automatically logged in at gist). both laravel and wordpress will use different database (or user tables at least). i can create a user in laravel when someone register at wordpress. but i have no clue how to share login session. why both ? we are using different readily available plugins of woocommerce (multiple subscriptions, addons, product variants etc) which will take a lot of time to port to laravel. any help would be great"
and the solution that they gave was given was
Route::get('/wordpress', function(){
require('..\wordpress\wp-load.php');
return loginUser(Auth::user()->username);
});
This part goes in the wordpress function.php
function loginFunction($username){
$user_id = username_exists($username);
$userdata = get_userdata($user_id);
$user = set_current_user($user_id,$username);
wp_set_auth_cookie($user_id);
do_action('wp_login',$userdata->ID);
// you can redirect the authenticated user to the "logged-in-page", define('MY_PROFILE_PAGE',1); f.e. first
header("Location:".get_page_link(MY_PROFILE_PAGE));
}
but when I do this I am given an error when I load the /wordpress route
FatalErrorException in l10n.php line 203:
Cannot redeclare __() (previously declared in C:\wamp64\www\sunfield\vendor\laravel\framework\src\Illuminate\Foundation\helpers.php:848)
This is a brand new project and I am getting this error :( here's a link to the original post: https://laracasts.com/discuss/channels/general-discussion/sharing-login-between-laravel-wordpress?page=1
if you guys know of a much easier way to incorporate this login system across both platforms I would love to hear!
Please or to participate in this conversation.