mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 16:24:04 +00:00
Model timestamps
This commit is contained in:
parent
4b5554dcac
commit
6b103cd2cb
6 changed files with 10 additions and 6 deletions
|
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\StorageDrivers\Database;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Stancl\Tenancy\Contracts\StorageDriver;
|
||||
use Stancl\Tenancy\DatabaseManager;
|
||||
use Stancl\Tenancy\Exceptions\DomainsOccupiedByOtherTenantException;
|
||||
|
|
@ -84,9 +85,10 @@ class DatabaseStorageDriver implements StorageDriver
|
|||
|
||||
$domainData = [];
|
||||
foreach ($tenant->domains as $domain) {
|
||||
$domainData[] = ['domain' => $domain, 'tenant_id' => $tenant->id];
|
||||
$domainData[] = ['domain' => $domain, 'tenant_id' => $tenant->id, 'created_at' => Carbon::now()];
|
||||
}
|
||||
Domains::create($domainData);
|
||||
|
||||
Domains::insert($domainData);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class DomainModel extends Model
|
|||
protected $guarded = [];
|
||||
protected $primaryKey = 'domain';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
public function getTable()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class TenantModel extends Model
|
|||
protected $guarded = [];
|
||||
protected $primaryKey = 'id';
|
||||
public $incrementing = false;
|
||||
public $timestamps = false;
|
||||
|
||||
public function getTable()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue