1. Go to this page and download the library: Download vidwan/tenant-buckets library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Vidwan\TenantBuckets\Jobs\CreateTenantBucket;
use Vidwan\TenantBuckets\Jobs\DeleteTenantBucket;
...
public function events()
{
return [
// Tenant events
...
Events\TenantCreated::class => [
JobPipeline::make([
Jobs\CreateDatabase::class,
Jobs\MigrateDatabase::class,
Jobs\SeedDatabase::class,
// Your own jobs to prepare the tenant.
// Provision API keys, create S3 buckets, anything you want!
CreateTenantBucket::class, // <-- Place it Here
])->send(function (Events\TenantCreated $event) {
return $event->tenant;
})->shouldBeQueued(false),
],
...
Events\DeletingTenant::class => [
JobPipeline::make([
DeleteTenantBucket::class, // <-- Place it Here
])->send(function (Events\DeletingTenant $event) {
return $event->tenant;
})->shouldBeQueued(false),
],
...
];
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.