1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 23:34:03 +00:00

Fix event listener tests, improve domain logic

This commit is contained in:
Samuel Štancl 2020-05-09 02:49:08 +02:00
parent 0bbc66f451
commit a602cec940
13 changed files with 148 additions and 14 deletions

View file

@ -0,0 +1,17 @@
<?php
namespace Stancl\Tenancy\Database\Models\Concerns;
/**
* @property-read string $primary_domain_hostname
*/
trait PrimaryDomain
{
// This string should usually come from a relationship implemented by you.
abstract public function getPrimaryDomainHostnameAttribute(): string;
public function route($route, $parameters = [], $absolute = true)
{
return tenant_route($this->primary_domain_hostname, $route, $parameters, $absolute);
}
}