mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
Refactor more old code and get tests to pass
This commit is contained in:
parent
c5377a16f7
commit
c32f229dd5
72 changed files with 425 additions and 531 deletions
17
src/Database/Concerns/PrimaryDomain.php
Normal file
17
src/Database/Concerns/PrimaryDomain.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Database\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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue