-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, #2256
Comments
@rnooxx999 Here is the temporary solution: Link |
If you're dealing with the following error message:
it's likely because the JWT 'ttl' (time to live) value was passed as a string instead of an integer. I found that this could be fixed by casting the 'ttl' to an integer in the JWT configuration file. Here's what I did to resolve the issue: // Inside config/jwt.php
'ttl' => (int) env('JWT_TTL', 60), // Cast to int to avoid errors If you need to change the 'ttl' to a different value, like 4320, be cautious about how you set it in your // Inside config/jwt.php
'ttl' => (int) env('JWT_TTL', 4320), // Ensures 'ttl' is always cast to int This way, regardless of how the 'ttl' value is specified in the environment file, you can be sure that it will be correctly interpreted as an integer, preventing the type mismatch error. Hopefully, this helps you avoid similar issues. |
…ent variable The env file is passing values as string and if manually the developer set the JWT_TTL value in the env file an error of : ``` Carbon\\Carbon::rawAddUnit(): Argument tymondesigns#3 ($value) must be of type int|float, string given, ``` will appear Fixes tymondesigns#2256
Thank you it's Work .. |
after updating Laravel to version 11 this problem showing up
TypeError: Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in Documents/Sites/../vendor/nesbot/carbon/src/Carbon/Traits/Units.php on line 356 in file /Documents/Sites/../vendor/nesbot/carbon/src/Carbon/Traits/Units.php on line 455
The text was updated successfully, but these errors were encountered: