File tree Expand file tree Collapse file tree 7 files changed +44
-9
lines changed Expand file tree Collapse file tree 7 files changed +44
-9
lines changed Original file line number Diff line number Diff line change 21
21
use Stancl \Tenancy \Middleware \InitializeTenancyByRequestData ;
22
22
use Stancl \Tenancy \Bootstrappers \Integrations \FortifyRouteBootstrapper ;
23
23
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
+ */
24
39
class TenancyServiceProvider extends ServiceProvider
25
40
{
26
41
// By default, no namespace is used to support the callable array syntax.
Original file line number Diff line number Diff line change 8
8
use Stancl \Tenancy \Enums \RouteMode ;
9
9
use Stancl \Tenancy \UniqueIdentifierGenerators ;
10
10
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
+ */
11
26
return [
12
27
/**
13
28
* Configuration for the models used by Tenancy.
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ services:
80
80
image : mcr.microsoft.com/mssql/server:2022-latest
81
81
environment :
82
82
- 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
84
84
healthcheck : # https://github.com/Microsoft/mssql-docker/issues/133#issuecomment-1995615432
85
85
test : timeout 2 bash -c 'cat < /dev/null > /dev/tcp/127.0.0.1/1433'
86
86
interval : 10s
Original file line number Diff line number Diff line change 11
11
use Stancl \Tenancy \Enums \RouteMode ;
12
12
13
13
/**
14
- * todo@name come up with a better name.
15
- *
16
14
* Prevents accessing central domains in the tenant context/tenant domains in the central context.
17
15
* The access isn't prevented if the request is trying to access a route flagged as 'universal',
18
16
* or if this middleware should be skipped.
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ class Tenancy
24
24
*/
25
25
public Tenant |null $ tenant = null ;
26
26
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
+ */
28
32
public ?Closure $ getBootstrappersUsing = null ;
29
33
30
34
/** Is tenancy fully initialized? */
@@ -131,12 +135,12 @@ public function end(): void
131
135
/** @return TenancyBootstrapper[] */
132
136
public function getBootstrappers (): array
133
137
{
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 .
135
139
$ resolve = $ this ->getBootstrappersUsing ?? function (Tenant $ tenant ) {
136
140
return config ('tenancy.bootstrappers ' );
137
141
};
138
142
139
- // Here We instantiate the bootstrappers and return them.
143
+ // Here we instantiate the bootstrappers and return them.
140
144
return array_map ('app ' , $ resolve ($ this ->tenant ));
141
145
}
142
146
Original file line number Diff line number Diff line change @@ -36,7 +36,12 @@ function tenant(?string $key = null): mixed
36
36
}
37
37
38
38
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
+ */
40
45
function tenant_asset (string |null $ asset ): string
41
46
{
42
47
if ($ assetUrl = config ('app.asset_url ' )) {
Original file line number Diff line number Diff line change 18
18
Event::listen (TenancyEnded::class, RevertToCentralContext::class);
19
19
});
20
20
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
-
23
21
test ('create storage symlinks action works ' , function () {
24
22
config ([
25
23
'tenancy.bootstrappers ' => [
You can’t perform that action at this time.
0 commit comments