Support the ongoing development of Laravel.io →
Database Requests Session

Ok, so I'm trying to create a support code that expires and is updated with a random code every 24 hours, however there seems to be a bit of an odd bug with carbon. Despite me adding 24 hours to carbon, the expire date is not having 24 hours added, however, the weird thing is it works with commands when I output the change as text to the command line. Also, despite me specifying utc, it doesn't seem to be using utc. The relevant code and screenshots are linked below.

Registration Code

Laravel Command

Database

Last updated 3 years ago.
0

Are you trying to add email verification ? If so you might just have a look at the email verification helper/middleware

0

can you try Carbon::now()->setTimezone('UTC)->addHours(24);

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

xaoseric xaoseric Joined 3 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.