Skip to content

Commit

Permalink
Set the console logo in service provider instead of application config
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jan 25, 2023
1 parent 823611d commit 99f177a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
12 changes: 2 additions & 10 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

/*
|--------------------------------------------------------------------------
| Application Name (Logo)
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
Expand All @@ -24,15 +24,7 @@
|
*/

'name' => "
\033[34m __ __ __ \033[33m ___ __ _____
\033[34m / // /_ _____/ /__ \033[33m/ _ \/ // / _ \
\033[34m / _ / // / _ / -_)\033[33m ___/ _ / ___/
\033[34m /_//_/\_, /\_,_/\__/\033[33m_/ /_//_/_/
\033[34m /___/
\033[0m",
'name' => 'HydePHP',

/*
|--------------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions packages/framework/src/Console/HydeConsoleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

use Illuminate\Support\ServiceProvider;

use Illuminate\Console\Application as Artisan;

/**
* Register the HydeCLI console commands.
*/
Expand Down Expand Up @@ -36,5 +38,23 @@ public function register(): void
Commands\ServeCommand::class,
Commands\DebugCommand::class,
]);

Artisan::starting(function (Artisan $artisan): void {
$artisan->setName(self::logo());
});
}

protected static function logo(): string
{
return <<<ASCII
\033[34m __ __ __ \033[33m ___ __ _____
\033[34m / // /_ _____/ /__ \033[33m/ _ \/ // / _ \
\033[34m / _ / // / _ / -_)\033[33m ___/ _ / ___/
\033[34m /_//_/\_, /\_,_/\__/\033[33m_/ /_//_/_/
\033[34m /___/
\033[0m
ASCII;
}
}

0 comments on commit 99f177a

Please sign in to comment.