mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 09:04:04 +00:00
Fix asset publishing
This commit is contained in:
parent
4d6003eec0
commit
0508429e0f
7 changed files with 22 additions and 15 deletions
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
namespace Stancl\Tenancy\Database\Concerns;
|
||||
|
||||
/**
|
||||
* This trait lets you add a "data" column functionality to any Eloquent model.
|
||||
* It serializes attributes which don't exist as columns on the model's table
|
||||
* into a JSON column named data (customizable by overriding getDataColumn).
|
||||
*/
|
||||
trait HasDataColumn
|
||||
{
|
||||
public static $priorityListeners = [];
|
||||
|
|
@ -118,4 +123,4 @@ trait HasDataColumn
|
|||
{
|
||||
return array_merge(['id'], config('tenancy.custom_columns'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,15 @@ trait HasDomains
|
|||
{
|
||||
return $this->hasMany(config('tenancy.domain_model'), 'tenant_id');
|
||||
}
|
||||
|
||||
public function createDomain($data): Domain
|
||||
{
|
||||
$class = config('tenancy.domain_model');
|
||||
|
||||
$domain = (new $class)->fill($data);
|
||||
$domain->tenant()->associate($this);
|
||||
$domain->save();
|
||||
|
||||
return $domain;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue