mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 07:54:03 +00:00
Add route helper
This is a convenience method which makes testing assertions about where the application is redirecting to.
This commit is contained in:
parent
6fdc041f88
commit
acd9d99ccb
1 changed files with 17 additions and 0 deletions
|
|
@ -383,6 +383,23 @@ class Tenant implements ArrayAccess
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a route specific to this tenant.
|
||||||
|
*
|
||||||
|
* @param String $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function route($path)
|
||||||
|
{
|
||||||
|
$path = $path[0] !== '/' ? '/'.$path : $path;
|
||||||
|
|
||||||
|
$url = $this->app->config->get('app.url');
|
||||||
|
$subdomain = $this->domains[0];
|
||||||
|
$scheme = parse_url($url, PHP_URL_SCHEME);
|
||||||
|
|
||||||
|
return sprintf('%s://%s%s', $scheme, $subdomain, $path);
|
||||||
|
}
|
||||||
|
|
||||||
public function __get($key)
|
public function __get($key)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue