-
-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tenant unaware feature and overall "features" feature improvements #1021
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #1021 +/- ##
============================================
- Coverage 89.71% 89.69% -0.02%
- Complexity 575 585 +10
============================================
Files 138 138
Lines 1769 1785 +16
============================================
+ Hits 1587 1601 +14
- Misses 182 184 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Resubmitted in v4 repo |
This PR adds the ability to bootstrap features early in the request life cycle. In simple words, You can bootstrap the feature without waiting for tenancy initialization. We are calling these tenant unaware feature.
Solution
PR introduces the new config key, which is an array of tenant-unaware features. For now,
CrossDomainRedirect
is added to this array. This also closes #949Usage
You add your own tenant unaware feature in tenancy.php.
Improvements
With the old approach, I noticed that the "$tenancy" object is passed but the tenancy is not initialized at this point. This happening because tenancy is not initiated yet. Maybe that's why current feature classes are not making use of the
tenancy
parameter. One feature was using actually, to add macro, but macro can be added statically likeTenancy::macro
.So the following got changed.
$tenancy
parameter from theFeature
interfacebootstrap
method. Now all tenantunaware
&aware
features have the same abstractions.->resolving(Tenancy)
event. That means we can use DI.The question can be how to develop tenant-aware features. Most probably using the
Tenancy events
.