You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is using Laravel v11, Carbon v3 and short-url v8.1.2
I am using the default factories in my test but when I create an inactive short url using the inactive() factory state and test getting the short url it returns a 500 type error. It seems this is because the Carbon\Carbon::isBefore() only allows a DateInterface or string and not null.
I have just upgraded to Laravel 11 which is now including Carbon v3 instead of v2.
TypeError: Carbon\Carbon::isBefore(): Argument #1 ($date) must be of type DateTimeInterface|string, null given, called in /my-app/vendor/ashallendesign/short-url/src/Classes/Resolver.php on line 59 and defined in /my-app/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php:239
useAshAllenDesign\ShortURL\Models\ShortURL;
it('returns 404 for inactive url', function () {
$inactiveShortURL = ShortURL::factory()->inactive()->create();
get(config('short-url.prefix').'/'.$inactiveShortURL->url_key)
->assertStatus(404);
});
This calls the class Resolver.php and fails on line 59:
if (now()->isBefore($shortURL->activated_at)) {
returnfalse;
}
The text was updated successfully, but these errors were encountered:
Hi,
This is using Laravel v11, Carbon v3 and short-url v8.1.2
I am using the default factories in my test but when I create an inactive short url using the inactive() factory state and test getting the short url it returns a 500 type error. It seems this is because the Carbon\Carbon::isBefore() only allows a DateInterface or string and not
null
.I have just upgraded to Laravel 11 which is now including Carbon v3 instead of v2.
This calls the class Resolver.php and fails on line 59:
The text was updated successfully, but these errors were encountered: