File "AskToStarRepoOnGitHub.php"
Full path: /home/orbitecv/orbite-school.orbit.et/vendor/spatie/laravel-package-tools/src/Commands/Concerns/AskToStarRepoOnGitHub.php
File size: 917 B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Edit Back
<?php
namespace Spatie\LaravelPackageTools\Commands\Concerns;
trait AskToStarRepoOnGitHub
{
protected ?string $starRepo = null;
public function askToStarRepoOnGitHub($vendorSlashRepoName): self
{
$this->starRepo = $vendorSlashRepoName;
return $this;
}
protected function processStarRepo(): self
{
if ($this->starRepo) {
if ($this->confirm('Would you like to star our repo on GitHub?')) {
$repoUrl = "https://github.com/{$this->starRepo}";
if (PHP_OS_FAMILY == 'Darwin') {
exec("open {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Windows') {
exec("start {$repoUrl}");
}
if (PHP_OS_FAMILY == 'Linux') {
exec("xdg-open {$repoUrl}");
}
}
}
return $this;
}
}