The feature was pretty much a soft-bootstrapper -- it listened
to both Bootstrapped and Reverted. Bootstrappers have a few more
protections in terms of error handling and safe reverting, so there's
no point in (badly) re-implementing bootstrapper functionality within
TenantConfig just so it could be a Feature.
Going forward, all Features should be things that are mostly agnostic
of the tenant state, and especially they should not use bootstrapped/
reverted events. Bootstrappers are simply more appropriate and safe.
Features are now *always* bootstrapped, even if Tenancy is not resolved
from the container.
Previous implementations include
https://github.com/tenancy-for-laravel/v4/pull/19https://github.com/archtechx/tenancy/pull/1021
Bug originally reported here
https://github.com/archtechx/tenancy/issues/949
This implementation is much simpler, we do not distinguish between
features that should be "always bootstrapped" and features that should
only be bootstrapped after Tenancy is resolved. All features should work
without issues if they're bootstrapped when TSP::boot() is called. We
also add a Tenancy::bootstrapFeatures() method that can be used to
bootstrap any features dynamically added at runtime that weren't
bootstrapped in TSP::boot(). The function keeps track of which features
were already bootstrapped so it doesn't bootstrap them again.
The only potentialy risky thing in this implementation is that we're now
resolving Tenancy in TSP::boot() (previously Tenancy was not being
resolved) but that shouldn't be causing any issues.
* Add Laravel 12 support, drop Laravel 11 support
* Fix RLS tree generation (specify schema name in generateTrees())
* ci fixes, use stable virtualcolumn version
---------
Co-authored-by: lukinovec <lukinovec@gmail.com>
* exclude master from CI
* Add space after 'up' in 'docker-compose up-d' (#900)
* Fix ArgumentCountError on the TenantAssetsController (#894)
* Fix ArgumentCount exception on the TenantAssetsController when no `$path` is provided
* CS
* CS
* Handle null case explicitly
* code style
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: Samuel Štancl <samuel@archte.ch>
* Add support for nested tenant config override (#920)
* feat: add support for nested tenant config override
* test: ensure nested tenant values are mapped
* Update TenantConfigTest.php
Co-authored-by: lukinovec <lukinovec@gmail.com>
Co-authored-by: Bram Wubs <megawubs@users.noreply.github.com>
Co-authored-by: Bram Wubs <bram@sibi.nl>
Co-authored-by: George Bishop <email.georgebishop@gmail.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>
* Add Pest dependencies
* Add base Pest file
* Convert test cases
* Remove non-compound imports
* Adopt expectation API
* Optimize uses
* Shift cleanup
* phpunit -> pest
* Fix tests in PR #884 PHPUnit to Pest Converter (#885)
* fixed tests, remove method duplications, restore necessary inner classes
* Update CommandsTest.php
* temporary checks run on `shift-64622` on branch.
* fixed `TestSeeder` class not resolved
* fixed messed up names
* removed `uses` from individual files and add it in `Pest`
* extract tests to helpers
* use pest dataset
* Update AutomaticModeTest.php
* newline
* todo convention
* resolve reviews
* added `// todo@tests`
* remove shift branch from CI workflow
Co-authored-by: Samuel Štancl <samuel@archte.ch>
* check if I have write permission
* Convert newly added tests to Pest
Co-authored-by: Shift <shift@laravelshift.com>
Co-authored-by: Abrar Ahmad <abrar.dev99@gmail.com>