So when you create the user, you are just setting the expiry date of the trial, but you are not creating a subscription from what I can see in the code above.
So if the user wants to upgrade in the middle of the trial period, you should not use now()->addMonth() because that will give them new 30 days. So with your example above, if 10 days already passed, and they chose a plan, you are giving them 30 days from the day they chose a plan.
This should do it:
public function upgradeFromTrial(Request $request) {
$user = $request->user();
if ($user->onTrial())
{
$user->newSubscription(
'default',
$request->priceId
)->trialUntil($user->expiry_date)->create($request->token);
}
else
{
$user->newSubscription(
'default',
$request->priceId
)->create($request->token);
}
}