mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 01:34:02 +00:00
StorageDrivers\Database domain
This commit is contained in:
parent
048a38a308
commit
23a4fd24b0
5 changed files with 113 additions and 94 deletions
23
src/StorageDrivers/Database/DomainModel.php
Normal file
23
src/StorageDrivers/Database/DomainModel.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\StorageDrivers\Database;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @internal Class is subject to breaking changes in minor and patch versions.
|
||||
*/
|
||||
class DomainModel extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
protected $primaryKey = 'id';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
public function getConnectionName()
|
||||
{
|
||||
return config('tenancy.storage.db.connection') ?? app(DatabaseManager::class)->originalDefaultConnectionName;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue