feat: [#667] Registering service providers don't dependent order#54
Merged
feat: [#667] Registering service providers don't dependent order#54
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Goravel Postgres driver by introducing a new relationship-based registration method, updating dependencies, and streamlining installation and testing instructions.
- Add a
Relationshipmethod toServiceProviderfor defining bindings, dependencies, and provisions - Bump
github.com/goravel/frameworkandgithub.com/dromara/carbon/v2versions ingo.mod - Simplify installation steps and add testing instructions in
README.md
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| service_provider.go | Added Relationship method, updated receiver names to r, imported binding |
| go.mod | Updated goravel/framework to v1.15.2-0.20250701070909-51b5ee2aed12 and carbon/v2 to v2.6.9 |
| README.md | Rewrote install steps using ./artisan package:install, added a Testing section |
Comments suppressed due to low confidence (2)
service_provider.go:19
- Add unit tests to verify the Relationship method returns the correct Bindings, Dependencies, and ProvideFor values to ensure this new registration mechanism works as intended.
func (r *ServiceProvider) Relationship() binding.Relationship {
README.md:23
- [nitpick] Revise this line to 'Run the following command to run tests:' for clarity and correct grammar.
Run command below to run test:
|
|
||
| func (receiver *ServiceProvider) Boot(app foundation.Application) { | ||
| func (r *ServiceProvider) Boot(app foundation.Application) { | ||
|
|
There was a problem hiding this comment.
[nitpick] The Boot method is currently empty; consider removing it if not needed or adding a comment to explain why it's intentionally left blank for clarity.
Suggested change
| // The Boot method is intentionally left blank as it is not currently needed. | |
| // It may be implemented in the future if additional bootstrapping logic is required. |
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.
📑 Description
Closes goravel/goravel#667
This pull request introduces several updates to the Goravel Postgres driver, including improvements to the installation process, dependency updates, and enhancements to the
ServiceProviderimplementation. The most important changes are grouped below by theme.Documentation Updates:
README.md, replacing manual setup steps with a single command (./artisan package:install) and linking to a setup file for manual installation. Testing instructions were also added.Dependency Updates:
github.com/goravel/frameworkto a newer version (v1.15.2-0.20250701070909-51b5ee2aed12) ingo.mod.github.com/dromara/carbon/v2tov2.6.9ingo.mod.Code Enhancements:
binding.Relationshipmethod to theServiceProviderclass inservice_provider.go, defining bindings, dependencies, and provisions for database and ORM components.ServiceProvidermethods (RegisterandBoot) to use a consistent receiver name (r).Import Adjustments:
github.com/goravel/framework/contracts/bindinginservice_provider.goto support the newbinding.Relationshipmethod.✅ Checks