Updated short URL creation responses to include more information

This commit is contained in:
Alejandro Celaya
2018-09-12 20:32:58 +02:00
parent 17779dbbc6
commit f3c92f4110
10 changed files with 39 additions and 32 deletions

View File

@@ -115,10 +115,10 @@ class GenerateShortcodeCommand extends Command
$this->getOptionalDate($input, 'validUntil'),
$customSlug,
$maxVisits !== null ? (int) $maxVisits : null
);
$shortUrl = (new Uri())->withPath($shortCode)
->withScheme($this->domainConfig['schema'])
->withHost($this->domainConfig['hostname']);
)->getShortCode();
$shortUrl = (string) (new Uri())->withPath($shortCode)
->withScheme($this->domainConfig['schema'])
->withHost($this->domainConfig['hostname']);
$io->writeln([
\sprintf('%s <info>%s</info>', $this->translator->translate('Processed long URL:'), $longUrl),