Skip to content

Commit 1f4701f

Browse files
committed
Add better info logs
1 parent a024ffb commit 1f4701f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

GenerateTypeScriptInterfaceFromModel.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,22 @@ class GenerateTypeScriptInterfaceFromModel extends Command {
2424
*/
2525
protected $description = 'Generate a TypeScript interface from a model';
2626

27+
/**
28+
* The supported database connections.
29+
*
30+
* @var array
31+
*/
32+
private const SUPPORTED_DATABASE_CONNECTIONS = [
33+
'mysql',
34+
];
35+
2736
/**
2837
* Check if the current database connection type is supported.
2938
*
3039
* @return bool
3140
*/
3241
private function hasSupportedDatabaseConnection(): bool {
33-
return collect(['mysql'])->contains(DB::getDefaultConnection());
42+
return collect(self::SUPPORTED_DATABASE_CONNECTIONS)->contains(DB::getDefaultConnection());
3443
}
3544

3645
/**
@@ -147,7 +156,8 @@ public function handle(): int {
147156
}
148157

149158
if (!$this->hasSupportedDatabaseConnection()) {
150-
$this->error('We currently only support a MySQL connection!');
159+
$this->error('Your database connection is currently unsupported!');
160+
$this->info('The following database connections are supported: ' . collect(self::SUPPORTED_DATABASE_CONNECTIONS)->join(', '));
151161

152162
return Command::FAILURE;
153163
}

0 commit comments

Comments
 (0)