refactor: hardcode Bowli mobile scheme
This commit is contained in:
@@ -4,23 +4,18 @@ namespace App\Services;
|
||||
|
||||
class MobileDeepLink
|
||||
{
|
||||
private const string SCHEME = 'bowli';
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $query
|
||||
*/
|
||||
public static function to(string $path, array $query = []): string
|
||||
{
|
||||
$url = sprintf('%s://%s', self::scheme(), ltrim($path, '/'));
|
||||
$url = sprintf('%s://%s', self::SCHEME, ltrim($path, '/'));
|
||||
$queryString = http_build_query($query, '', '&', PHP_QUERY_RFC3986);
|
||||
|
||||
return $queryString === ''
|
||||
? $url
|
||||
: "{$url}?{$queryString}";
|
||||
}
|
||||
|
||||
private static function scheme(): string
|
||||
{
|
||||
$scheme = rtrim((string) config('app.mobile_scheme', 'bowly'), ':/');
|
||||
|
||||
return $scheme !== '' ? $scheme : 'bowly';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user