mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 08:24:03 +00:00
Merge branch 'master' into 515-complete
This commit is contained in:
commit
69e4a1ef2a
102 changed files with 1539 additions and 558 deletions
|
|
@ -24,7 +24,7 @@ class CreateDatabase implements ShouldQueue
|
|||
) {
|
||||
}
|
||||
|
||||
public function handle(DatabaseManager $databaseManager)
|
||||
public function handle(DatabaseManager $databaseManager): bool
|
||||
{
|
||||
event(new CreatingDatabase($this->tenant));
|
||||
|
||||
|
|
@ -38,5 +38,7 @@ class CreateDatabase implements ShouldQueue
|
|||
$this->tenant->database()->hostManager()->createDatabase($this->tenant);
|
||||
|
||||
event(new DatabaseCreated($this->tenant));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
28
src/Jobs/CreateStorageSymlinks.php
Normal file
28
src/Jobs/CreateStorageSymlinks.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Stancl\Tenancy\Actions\CreateStorageSymlinksAction;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
|
||||
class CreateStorageSymlinks implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(
|
||||
public Tenant $tenant,
|
||||
) {
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
CreateStorageSymlinksAction::handle($this->tenant);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,14 +9,12 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Stancl\Tenancy\Database\Concerns\HasDomains;
|
||||
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
|
||||
|
||||
class DeleteDomains
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
/** @var TenantWithDatabase&Model&HasDomains */ // todo unresolvable type for phpstan
|
||||
protected TenantWithDatabase&Model $tenant;
|
||||
|
||||
public function __construct(TenantWithDatabase&Model $tenant)
|
||||
|
|
|
|||
40
src/Jobs/RemoveStorageSymlinks.php
Normal file
40
src/Jobs/RemoveStorageSymlinks.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Jobs;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Stancl\Tenancy\Actions\RemoveStorageSymlinksAction;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
|
||||
class RemoveStorageSymlinks implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public Tenant $tenant;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Tenant $tenant)
|
||||
{
|
||||
$this->tenant = $tenant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
RemoveStorageSymlinksAction::handle($this->tenant);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue