Refactor notification summary handling to use Summary value object - #2
Merged
Conversation
thijskok
force-pushed
the
added-summary-return-object
branch
from
July 27, 2026 19:25
a136044 to
75862c6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Refactors the notification summary payload from a loose array shape to a dedicated Summary value object, updating the public toSummary() contract and adapting mail/database rendering accordingly.
Changes:
- Introduces
TestMonitor\Floodgate\Notifications\Summary(fluent builder +toArray()for database channel payloads). - Updates
toSummary()signatures (contract + trait + test notification) to returnSummary, and updatesSummaryNotificationto delegate array conversion and mail subject selection to it. - Updates the summary mail Blade view + README + tests to use the new object model and add coverage for optional title/subject/action behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SummaryTest.php | Adds unit coverage for Summary::with() and Summary::toArray() behavior. |
| tests/SummaryNotificationTest.php | Updates existing summary tests to use Summary and adds mail rendering tests for title/subject/action. |
| tests/Notifications/TestNotification.php | Updates toSummary() to return a Summary instance. |
| tests/FlushingNotificationsTest.php | Updates expected database payload key from properties to data. |
| src/Notifications/SummaryNotification.php | Accepts a Summary object and delegates array conversion + mail subject selection to it. |
| src/Notifications/Summary.php | New value object encapsulating summary fields and array serialization. |
| src/Contracts/Gated.php | Changes toSummary() contract return type to Summary. |
| src/Concerns/Gateable.php | Changes abstract toSummary() return type to Summary. |
| resources/views/summary.blade.php | Renders the Summary object (title/message/data + optional action button). |
| README.md | Updates documentation/examples for the new Summary API and customization guidance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # {{ __($summary->title, $summary->data) }} | ||
| @endif | ||
|
|
||
| {{ __($summary->message, $summary->data) }} |
Comment on lines
+16
to
+18
| @if ($summary->actionText) | ||
| @component('mail::button', ['url' => $summary->actionUrl]) | ||
| @lang($summary->actionText) |
Contributor
Author
There was a problem hiding this comment.
Mimicking Laravel :)
Frankisgek
approved these changes
Jul 28, 2026
stefanius
approved these changes
Jul 28, 2026
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.
No description provided.