mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 21:54:03 +00:00
Configurable table names
This commit is contained in:
parent
d1be6c8e66
commit
2cf2ef0995
3 changed files with 15 additions and 3 deletions
|
|
@ -10,7 +10,11 @@ return [
|
||||||
'custom_columns' => [
|
'custom_columns' => [
|
||||||
// 'plan',
|
// 'plan',
|
||||||
],
|
],
|
||||||
'connection' => 'central',
|
'connection' => null, // todo verify this works
|
||||||
|
'table_names' => [
|
||||||
|
'TenantModel' => 'tenants',
|
||||||
|
'DomainModel' => 'domains',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'redis' => [ // Stancl\Tenancy\StorageDrivers\RedisStorageDriver
|
'redis' => [ // Stancl\Tenancy\StorageDrivers\RedisStorageDriver
|
||||||
'connection' => 'tenancy',
|
'connection' => 'tenancy',
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,11 @@ class DomainModel extends Model
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
public $table = 'domains';
|
|
||||||
|
public function getTable()
|
||||||
|
{
|
||||||
|
return config('tenancy.storage.db.table_names.DomainModel', 'domains');
|
||||||
|
}
|
||||||
|
|
||||||
public function getConnectionName()
|
public function getConnectionName()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,11 @@ class TenantModel extends Model
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
public $table = 'tenants';
|
|
||||||
|
public function getTable()
|
||||||
|
{
|
||||||
|
return config('tenancy.storage.db.table_names.TenantModel', 'tenants');
|
||||||
|
}
|
||||||
|
|
||||||
public static function dataColumn()
|
public static function dataColumn()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue