Skip to content

Commit 7089efb

Browse files
committed
resolve minor todos
1 parent 413da36 commit 7089efb

File tree

7 files changed

+44
-9
lines changed

7 files changed

+44
-9
lines changed

assets/TenancyServiceProvider.stub.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@
2121
use Stancl\Tenancy\Middleware\InitializeTenancyByRequestData;
2222
use Stancl\Tenancy\Bootstrappers\Integrations\FortifyRouteBootstrapper;
2323

24+
/**
25+
* Tenancy for Laravel.
26+
*
27+
* Documentation: https://tenancyforlaravel.com
28+
*
29+
* We can sustainably develop Tenancy for Laravel thanks to our sponsors.
30+
* Big thanks to everyone listed here: https://github.com/sponsors/stancl
31+
*
32+
* You can also support us, and save time, by purchasing these products:
33+
* Exclusive content for sponsors: https://sponsors.tenancyforlaravel.com
34+
* Multi-Tenant SaaS boilerplate: https://portal.archte.ch/boilerplate
35+
* Multi-Tenant Laravel in Production e-book: https://portal.archte.ch/book
36+
*
37+
* All of these products can also be accessed at https://portal.archte.ch
38+
*/
2439
class TenancyServiceProvider extends ServiceProvider
2540
{
2641
// By default, no namespace is used to support the callable array syntax.

assets/config.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@
88
use Stancl\Tenancy\Enums\RouteMode;
99
use Stancl\Tenancy\UniqueIdentifierGenerators;
1010

11+
/**
12+
* Tenancy for Laravel.
13+
*
14+
* Documentation: https://tenancyforlaravel.com
15+
*
16+
* We can sustainably develop Tenancy for Laravel thanks to our sponsors.
17+
* Big thanks to everyone listed here: https://github.com/sponsors/stancl
18+
*
19+
* You can also support us, and save time, by purchasing these products:
20+
* Exclusive content for sponsors: https://sponsors.tenancyforlaravel.com
21+
* Multi-Tenant SaaS boilerplate: https://portal.archte.ch/boilerplate
22+
* Multi-Tenant Laravel in Production e-book: https://portal.archte.ch/book
23+
*
24+
* All of these products can also be accessed at https://portal.archte.ch
25+
*/
1126
return [
1227
/**
1328
* Configuration for the models used by Tenancy.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ services:
8080
image: mcr.microsoft.com/mssql/server:2022-latest
8181
environment:
8282
- ACCEPT_EULA=Y
83-
- SA_PASSWORD=P@ssword # todo reuse env from above
83+
- SA_PASSWORD=P@ssword # must be the same as TENANCY_TEST_SQLSRV_PASSWORD
8484
healthcheck: # https://github.com/Microsoft/mssql-docker/issues/133#issuecomment-1995615432
8585
test: timeout 2 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/1433'
8686
interval: 10s

src/Middleware/PreventAccessFromUnwantedDomains.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use Stancl\Tenancy\Enums\RouteMode;
1212

1313
/**
14-
* todo@name come up with a better name.
15-
*
1614
* Prevents accessing central domains in the tenant context/tenant domains in the central context.
1715
* The access isn't prevented if the request is trying to access a route flagged as 'universal',
1816
* or if this middleware should be skipped.

src/Tenancy.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ class Tenancy
2424
*/
2525
public Tenant|null $tenant = null;
2626

27-
// todo@docblock
27+
/**
28+
* Custom callback for providing a list of bootstrappers to use.
29+
* When this is null, config('tenancy.bootstrappers') is used.
30+
* @var ?Closure(): list<TenancyBootstrapper>
31+
*/
2832
public ?Closure $getBootstrappersUsing = null;
2933

3034
/** Is tenancy fully initialized? */
@@ -131,12 +135,12 @@ public function end(): void
131135
/** @return TenancyBootstrapper[] */
132136
public function getBootstrappers(): array
133137
{
134-
// If no callback for getting bootstrappers is set, we just return all of them.
138+
// If no callback for getting bootstrappers is set, we return the ones in config.
135139
$resolve = $this->getBootstrappersUsing ?? function (Tenant $tenant) {
136140
return config('tenancy.bootstrappers');
137141
};
138142

139-
// Here We instantiate the bootstrappers and return them.
143+
// Here we instantiate the bootstrappers and return them.
140144
return array_map('app', $resolve($this->tenant));
141145
}
142146

src/helpers.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ function tenant(?string $key = null): mixed
3636
}
3737

3838
if (! function_exists('tenant_asset')) {
39-
// todo@docblock
39+
/**
40+
* Generate a URL to an asset in tenant storage.
41+
*
42+
* If app.asset_url is set, this helper suffixes that URL before appending the asset path.
43+
* If it is not set, the stancl.tenancy.asset route is used.
44+
*/
4045
function tenant_asset(string|null $asset): string
4146
{
4247
if ($assetUrl = config('app.asset_url')) {

tests/ActionTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
1919
});
2020

21-
// todo@move move these to be in the same file as the other tests from this PR (#909) rather than generic "action tests"
22-
2321
test('create storage symlinks action works', function() {
2422
config([
2523
'tenancy.bootstrappers' => [

0 commit comments

Comments
 (0)