Add tenant configuration (closes #43) #44
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.
This PR implements an optional tenant configuration as requested in #43. The tests are all passing but I'm a bit unsure how to properly test that the tenant configuration is applied in
DatabaseAnalyticsRepository
since I didn't want to change the current migration file. The edits the end user will be making to add their tenant field may not be exactly like my use case (eg. could use a different field name or id type), and they may not build for multi-tenancy at all, so I felt it was best to just leave that as optional configuration. If you have any pointers on how this feature would be better implemented @nunomaduro, then I'm all ears!Note that I also removed the
@phpstan-ignore-line
statements inDatabaseAnalyticsRepository
since they weren't matching actual errors any longer, thereby causing PHPStan errors instead (perhaps changed by an update in larastan).