-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add command to remove vanity domains (#155)
* add command to remove vainty domains * fix style * Update VanityDomainDeleteCommand.php Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
f6614d9
commit c32c8fb
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Laravel\VaporCli\Commands; | ||
|
||
use Laravel\VaporCli\Helpers; | ||
use Laravel\VaporCli\Manifest; | ||
use Symfony\Component\Console\Input\InputArgument; | ||
|
||
class VanityDomainDeleteCommand extends Command | ||
{ | ||
/** | ||
* Configure the command options. | ||
* | ||
* @return void | ||
*/ | ||
protected function configure() | ||
{ | ||
$this | ||
->setName('vanity-domain:delete') | ||
->addArgument('environment', InputArgument::REQUIRED, 'The environment name') | ||
->setDescription('Delete the vanity domain associated with the given environment'); | ||
} | ||
|
||
/** | ||
* Execute the command. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
$environment = $this->argument('environment'); | ||
|
||
if (! Helpers::confirm("Are you sure you want to delete the vanity domain of the [{$environment}] environment", false)) { | ||
Helpers::abort('Action cancelled.'); | ||
} | ||
|
||
$this->vapor->deleteVanityDomain( | ||
Manifest::id(), | ||
$environment | ||
); | ||
|
||
Helpers::info('Vanity domain deletion initiated successfully.'); | ||
Helpers::line(); | ||
Helpers::line('The process may take several seconds to complete.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters