Make Admin Dashboard compatible with immutable Carbon Dates#2307
Merged
alecritson merged 2 commits intolunarphp:1.xfrom Oct 14, 2025
Merged
Make Admin Dashboard compatible with immutable Carbon Dates#2307alecritson merged 2 commits intolunarphp:1.xfrom
alecritson merged 2 commits intolunarphp:1.xfrom
Conversation
|
@thettler is attempting to deploy a commit to the NEON Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR makes the Admin Dashboard widgets compatible with immutable Carbon dates by updating method signatures to accept both DateTime and CarbonInterface types. The change fixes a type error that occurs when using CarbonImmutable dates in Laravel applications.
- Updated
getOrderQuerymethod signatures across all dashboard order widgets to accept\DateTime|CarbonInterface|nullparameters - Added necessary
use Carbon\CarbonInterface;imports to all affected widget classes
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| OrdersSalesChart.php | Updated getOrderQuery signature and added CarbonInterface import |
| OrderTotalsChart.php | Updated getOrderQuery signature and added CarbonInterface import |
| OrderStatsOverview.php | Updated getOrderQuery signature and added CarbonInterface import |
| NewVsReturningCustomersChart.php | Updated getOrderQuery signature and added CarbonInterface import |
| AverageOrderValueChart.php | Updated getOrderQuery signature and added CarbonInterface import |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
alecritson
approved these changes
Oct 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you want to use ImmutableDates in your Application with this line:
The Dashboard Widgets break because the signature of the
getOrderQuerymethods on the Widgets is to strict.The Error:
This PR changes the signature to accept also CarbonDates which solves the Problem.
Old Signature:
New Signature:
Warning
This is a breaking change for people who extended one or more widgets and have overwritten the
getOrderQuerymethod. But the Impact is in a non critical part and the required work to upgrade is minimal.