1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 00:54:04 +00:00
tenancy/src/Database/Concerns/CreatesDatabaseUsers.php
Samuel Štancl 657e165cc8
[4.x] Cleanup (#1317)
* cleanup, resolve todos, add immediate todos

* Improve path_identification_middleware docblock

* rename leave() method in tests

* wip fix hardcoded values making assumptions about the parameters used in routing

* defaultParameterNames

* fix CreatesDatabaseUsers return values

* $tenant -> tenant()

* resolve more todos

* make comment block a complete block

* Correct useTenantRoutesInFortify(), delete unused import

* test fixes

* remove todos

* remove JobPipeline todo

* simplify comment example

* remove todo

* fix VERSION_PREFIX in queue.yml

---------

Co-authored-by: lukinovec <lukinovec@gmail.com>
2025-02-20 20:49:09 +01:00

20 lines
511 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Database\Concerns;
use Stancl\Tenancy\Database\Contracts\TenantWithDatabase;
trait CreatesDatabaseUsers
{
public function createDatabase(TenantWithDatabase $tenant): bool
{
return parent::createDatabase($tenant) && $this->createUser($tenant->database());
}
public function deleteDatabase(TenantWithDatabase $tenant): bool
{
return $this->deleteUser($tenant->database()) && parent::deleteDatabase($tenant);
}
}