Skip to content

Commit

Permalink
[10.x] Only use Carbon if accessed from Laravel or also uses
Browse files Browse the repository at this point in the history
`illuminate/support`

fixes #49765

Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jan 22, 2024
1 parent d4f9dab commit b0ca27f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Illuminate/Collections/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,8 @@ protected function passthru($method, array $params)
*/
protected function now()
{
return Carbon::now()->timestamp;
return class_exists(Carbon::class)
? Carbon::now()->timestamp
: time();
}
}

0 comments on commit b0ca27f

Please sign in to comment.