1414/**
1515 * @internal
1616 */
17- #[AsCommand(name: 'nightwatch:deploy ' , description: 'Notice the Nightwatch agent that a new deployment has been made . ' )]
17+ #[AsCommand(name: 'nightwatch:deploy ' , description: 'Notify Nightwatch of a deployment. ' )]
1818final class DeployCommand extends Command
1919{
2020 /**
@@ -27,11 +27,10 @@ final class DeployCommand extends Command
2727 /**
2828 * @var string
2929 */
30- protected $ description = 'Notice the Nightwatch agent that a new deployment has been made . ' ;
30+ protected $ description = 'Notify Nightwatch of a deployment. ' ;
3131
3232 public function __construct (
3333 private HttpFactory $ http ,
34- private ?string $ baseUrl ,
3534 #[SensitiveParameter] private ?string $ token ,
3635 ) {
3736 parent ::__construct ();
@@ -41,11 +40,7 @@ public function handle(): void
4140 {
4241 $ tag = config ('nightwatch.deployment ' ) ?? '' ;
4342
44- if (! $ this ->baseUrl ) {
45- $ this ->error ('No Nightwatch base URL configured. ' );
46-
47- return ;
48- }
43+ $ baseUrl = $ _SERVER ['NIGHTWATCH_BASE_URL ' ] ?? 'https://nightwatch.laravel.com ' ;
4944
5045 if (! $ this ->token ) {
5146 $ this ->error ('No Nightwatch token configured. ' );
@@ -60,7 +55,7 @@ public function handle(): void
6055 'Accept ' => 'application/json ' ,
6156 'Content-Type ' => 'application/json ' ,
6257 ])
63- ->post ("{$ this -> baseUrl }/api/deployments " , [
58+ ->post ("{$ baseUrl }/api/deployments " , [
6459 'timestamp ' => now ()->timestamp ,
6560 'version ' => $ tag ,
6661 ]);
0 commit comments