generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
What happened?
I have three databases, which I have specified separately as connections in database.php.
php artisan model:show specifies the database, which is the connection. This means that the database is unfortunately defined as a connection in the SchemaModel class $data['database'].
I have corrected this for myself as follows (SchemaModel):
$connection = config('database.connections.' . $data['database']);
$self = new self(
$schemaClass,
$data['class'],
$connection['driver'],
$data['table'],
$data['policy'] ?? null,
[],
[],
$data['observers'] ?? [],
);
How to reproduce the bug
- Creating second database
- Add additional connection 'second_connection' in the database.php for the new database
- Set $connection to 'second_connection' in the Model
/**
* The database connection that should be used by the model.
*
* @var string
*/
protected $connection = 'second_connection';
- Run
php artisan typescriptable - Error because $databaseDriver 'second_connection' is not an Enum in the DatabaseDriverEnum
Package Version
3.1
PHP Version
8.3
Which operating systems does with happen with?
Linux
Notes
Sorry for bad bug report - it's my first ;-)
ewilan-riviere
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request