mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 06:04:03 +00:00
parent
3f650d887d
commit
15766a0037
12 changed files with 230 additions and 102 deletions
19
src/TenantDatabaseManagers/MySQLDatabaseManager.php
Normal file
19
src/TenantDatabaseManagers/MySQLDatabaseManager.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\TenantDatabaseManagers;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Stancl\Tenancy\Interfaces\TenantDatabaseManager;
|
||||
|
||||
class MySQLDatabaseManager implements TenantDatabaseManager
|
||||
{
|
||||
public function createDatabase(string $name): bool
|
||||
{
|
||||
return DB::statement("CREATE DATABASE `$name` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci");
|
||||
}
|
||||
|
||||
public function deleteDatabase(string $name): bool
|
||||
{
|
||||
return DB::statement("DROP DATABASE `$name`");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue