mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 10:14: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\Seed;
|
||||
use Illuminate\Cache\CacheManager;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Stancl\Tenancy\Commands\Install;
|
||||
use Stancl\Tenancy\Commands\Migrate;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Stancl\Tenancy\Commands\Rollback;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
|
@ -57,9 +57,9 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
RedirectResponse::macro('tenant', function (string $domain) {
|
||||
// replace first occurance of hostname fragment with $domain
|
||||
$url = $this->getTargetUrl();
|
||||
$hostname = parse_url($url, PHP_URL_HOST);
|
||||
$position = strpos($url, $hostname);
|
||||
$this->setTargetUrl(substr_replace($url, $domain, $position, strlen($hostname)));
|
||||
$hostname = \parse_url($url, PHP_URL_HOST);
|
||||
$position = \strpos($url, $hostname);
|
||||
$this->setTargetUrl(\substr_replace($url, $domain, $position, \strlen($hostname)));
|
||||
|
||||
return $this;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@ class TenantRedirectMacroTest extends TestCase
|
|||
$this->get('/redirect')
|
||||
->assertRedirect('http://abcd/foobar');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue