chore: Set version to 0.1.0 and add changelog - #1
Conversation
Use a standard composer 'version' field and start the package pre-1.0 ahead of its first tagged release.
Code Review SummaryThis PR performs necessary housekeeping by setting the package version and establishing a changelog. It also includes several refactors that modernize the code (moving towards native PHP functions) and improve naming consistency across the destination handlers. 🚀 Key Improvements
💡 Minor Suggestions
|
| @@ -0,0 +1,10 @@ | |||
| # Changelog | |||
|
|
|||
| ## [0.1.0] - 2026-07-23 | |||
There was a problem hiding this comment.
The year in the release date seems to be a future date (2026). Unless this is intentional, it is likely a typo and should be updated to reflect the actual release date.
| ## [0.1.0] - 2026-07-23 | |
| +## [0.1.0] - 2025-02-24 |
|
Coverage Report |
|
Coverage Report |
| - Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph | ||
| - Public, throttled submission endpoint that resolves a form by key and records the submission | ||
| - Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form | ||
| - Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting | ||
| - Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log | ||
| - A FormSubmittedEvent the host can bridge to its own workflows | ||
| - Config-driven throughout: destinations, protection thresholds, and the response formatter |
There was a problem hiding this comment.
To follow the 'Keep a Changelog' standard, items should be grouped under category headings such as ### Added. This improves readability and organization as the project evolves.
| - Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph | |
| - Public, throttled submission endpoint that resolves a form by key and records the submission | |
| - Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form | |
| - Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting | |
| - Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log | |
| - A FormSubmittedEvent the host can bridge to its own workflows | |
| - Config-driven throughout: destinations, protection thresholds, and the response formatter | |
| ### Added | |
| - Polymorphic form collection: a Form definition and its submissions, each scoped to any owning model via an owner morph | |
| - Public, throttled submission endpoint that resolves a form by key and records the submission | |
| - Pluggable, delivery-agnostic destinations (mail, webhook, Mautic, Smartpings) behind a destination contract, selectable per form | |
| - Spam protection: honeypot fields, a minimum submit time, and per-minute rate limiting | |
| - Typed submission columns (name, email, phone, subject, message) alongside an arbitrary payload, plus a delivery log | |
| - A FormSubmittedEvent the host can bridge to its own workflows | |
| - Config-driven throughout: destinations, protection thresholds, and the response formatter |
| { | ||
| throw new RuntimeException( | ||
| 'SmartPings destination is not implemented yet. Provide SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID so it can be built on smartpings/php-sdk and tested.' | ||
| 'SmartPings destination is not implemented yet. Set SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID before enabling it.' |
There was a problem hiding this comment.
The updated error message implies that setting the environment variables is sufficient to enable the destination. However, the method remains unimplemented and will still throw a RuntimeException. It is clearer to state that the implementation is pending integration.
| 'SmartPings destination is not implemented yet. Set SMARTPINGS_CLIENT_ID and SMARTPINGS_SECRET_ID before enabling it.' | |
| 'SmartPings destination is not implemented yet. It requires integration with the smartpings/php-sdk.' |
Rename short variables, lift an assignment out of an if condition, and drop an unused closure parameter so the mess detector passes.
| public function deliver(FormSubmission $submission): void | ||
| { | ||
| $to = optional($submission->form)->recipient_email | ||
| $recipient = optional($submission->form)->recipient_email |
There was a problem hiding this comment.
Since the project uses PHP 8.0+ features (like str_starts_with), you can replace the Laravel optional() helper with the native null-safe operator (?->). This is more idiomatic in modern PHP and avoids the overhead of a helper function call.
| $recipient = optional($submission->form)->recipient_email | |
| $recipient = $submission->form?->recipient_email |
Switches to a standard composer
versionfield (frompackage-version) and starts the package at0.1.0, pre-1.0, ahead of its first tagged release. Adds a matching CHANGELOG entry so the release workflow can cut the tag.