mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 02:24:03 +00:00
Fixed Link command for Laravel v6, added StorageLink Events, more StorageLink tests, added RemoveStorageSymlinks Job, added Storage Jobs to TenancyServiceProvider stub, renamed misleading config example.
This commit is contained in:
parent
717b834c51
commit
5ed5aea6d6
11 changed files with 253 additions and 15 deletions
|
|
@ -28,6 +28,7 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Jobs\CreateDatabase::class,
|
||||
Jobs\MigrateDatabase::class,
|
||||
// Jobs\SeedDatabase::class,
|
||||
Jobs\CreateStorageSymlinks::class,
|
||||
|
||||
// Your own jobs to prepare the tenant.
|
||||
// Provision API keys, create S3 buckets, anything you want!
|
||||
|
|
@ -44,6 +45,7 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Events\TenantDeleted::class => [
|
||||
JobPipeline::make([
|
||||
Jobs\DeleteDatabase::class,
|
||||
Jobs\RemoveStorageSymlinks::class,
|
||||
])->send(function (Events\TenantDeleted $event) {
|
||||
return $event->tenant;
|
||||
})->shouldBeQueued(false), // `false` by default, but you probably want to make this `true` for production.
|
||||
|
|
@ -87,6 +89,12 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Listeners\UpdateSyncedResource::class,
|
||||
],
|
||||
|
||||
// Storage symlinks
|
||||
Events\CreatingStorageSymlink::class => [],
|
||||
Events\StorageSymlinkCreated::class => [],
|
||||
Events\RemovingStorageSymlink::class => [],
|
||||
Events\StorageSymlinkRemoved::class => [],
|
||||
|
||||
// Fired only when a synced resource is changed in a different DB than the origin DB (to avoid infinite loops)
|
||||
Events\SyncedResourceChangedInForeignDatabase::class => [],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ return [
|
|||
*/
|
||||
'url_override' => [
|
||||
// The array key is local disk (must exist in root_override) and value is public directory (%tenant_id% will be replaced with actual tenant id).
|
||||
'public' => 'storage-%tenant_id%',
|
||||
'public' => 'public-%tenant_id%',
|
||||
],
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue