mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 13:54:04 +00:00
Apply fixes from StyleCI
This commit is contained in:
parent
31d0d44261
commit
a89017634b
2 changed files with 5 additions and 5 deletions
|
|
@ -5,9 +5,9 @@ namespace Stancl\Tenancy;
|
||||||
use Stancl\Tenancy\Commands\Run;
|
use Stancl\Tenancy\Commands\Run;
|
||||||
use Stancl\Tenancy\Commands\Seed;
|
use Stancl\Tenancy\Commands\Seed;
|
||||||
use Illuminate\Cache\CacheManager;
|
use Illuminate\Cache\CacheManager;
|
||||||
use Illuminate\Http\RedirectResponse;
|
|
||||||
use Stancl\Tenancy\Commands\Install;
|
use Stancl\Tenancy\Commands\Install;
|
||||||
use Stancl\Tenancy\Commands\Migrate;
|
use Stancl\Tenancy\Commands\Migrate;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Stancl\Tenancy\Commands\Rollback;
|
use Stancl\Tenancy\Commands\Rollback;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
@ -57,9 +57,9 @@ class TenancyServiceProvider extends ServiceProvider
|
||||||
RedirectResponse::macro('tenant', function (string $domain) {
|
RedirectResponse::macro('tenant', function (string $domain) {
|
||||||
// replace first occurance of hostname fragment with $domain
|
// replace first occurance of hostname fragment with $domain
|
||||||
$url = $this->getTargetUrl();
|
$url = $this->getTargetUrl();
|
||||||
$hostname = parse_url($url, PHP_URL_HOST);
|
$hostname = \parse_url($url, PHP_URL_HOST);
|
||||||
$position = strpos($url, $hostname);
|
$position = \strpos($url, $hostname);
|
||||||
$this->setTargetUrl(substr_replace($url, $domain, $position, strlen($hostname)));
|
$this->setTargetUrl(\substr_replace($url, $domain, $position, \strlen($hostname)));
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue