Updating nesbot/carbon (1.36.2 => 1.37.0)
After this update session in Laravel stopped working.
BadMethodCallExceptionMethod addMinutes does not exist.
in聽Macroable.php聽line 96
at聽Carbon->__call('addMinutes',聽array(120))in聽StartSession.php聽line 203
at聽StartSession->getCookieExpirationDate()in聽StartSession.php聽line 177
at聽StartSession->addCookieToResponse(object(JsonResponse),聽object(Store))in聽StartSession.php聽line 71
at聽StartSession->handle(object(Request),聽object(Closure))in聽Pipeline.php聽line 149
Illuminate\Support\Carbon does not seem to extend properly on Carbon\Carbon or something with Illuminate\Support\Traits\Macroable.
BadMethodCallExceptionMethod get thrown in Illuminate\Support\Traits\Macroable when it runs its magic __call-method.
Illuminate\Session\Middleware\StartSession\getCookieExpirationDate() where it tries to run addMinutes.
>>> Carbon\Carbon::now()->addMinutes(120);
=> Carbon\Carbon @1556883383 {#4145
date: 2019-05-03 13:36:23.282898 Europe/Stockholm (+02:00),
}
>>> Illuminate\Support\Carbon::now()->addMinutes(120);
BadMethodCallException with message 'Method addMinutes does not exist.'
Please fill out the issue template when posting bug reports.
+1, just after a composer update, the problem has appeared.
I tried to smash the vendor and to rebuild it but it does not change anything.
To reproduce the problem, you just have to execute a php artisan queue:restart in Laravel 5.5 and with php7.1 for example.
The following error is thrown :
In Macroable.php line 96:
Method addSeconds does not exist.
It has something to do with Carbon version 1.37.0. Installing 1.36.2 and clearing the bootstrap/cache folder fixes it. Have not found out what it is in Carbon 1.37.0 that causes it yet.
Edit:
Reported and seems to be an issue with mixed release tags, 1.37.0 contains breaking changes from 2.0.
https://github.com/briannesbitt/Carbon/issues/1708
Carbon tag removed, a new tag will replace it soon
Patch released. Run composer update to get it.
Going to close this then since it's a carbon issue.
@kylekatarnls thanks for looking into this so quickly 馃憤
Most helpful comment
Patch released. Run
composer updateto get it.