-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table in migration is not recognized if Schema facade starts specifying the connection #1058
Comments
Hello Leonardo! 👋 |
Yea I've just realised I have the same issue. Would be nice feature to have. |
Not sure if it's related but I'm getting a public function __construct(array $attributes = array())
{
parent::__construct($attributes);
// Dynamically set default database 'connection' from config
$this->setConnection(config('client-admin.database'));
// Dynamically set default database 'table' from config
$this->setTable(config('client-admin.table.clients'));
} The project is locked to Laravel 7 due to PHP 7.2 restrictions. |
Hello @tyler36 ! |
@szepeviktor Thanks for the feedback. I have it set this way so I can dynamically change the database during testing. |
I see! So your class property is not dynamic but the table name is. |
@szepeviktor yes. I've replicated an external database locally so I don't hit it during testing. Would this be considered a bug in how Larastan processes files? Do you want me to open a new issue? |
Larastan understands only simple migrations. |
I see. So Larastan does not support |
Could Larastan not just ignore the connection definition when scanning migrations? Just if the underlying migration is valid, the connection property could just be disregarded. |
Yes it could. |
Yes, this issue is just about that. That's why it's open. |
--level
used: 9Description
In the migration files, if we need to specify a connection for a specific schema operation, Laravel proposes
Schema::connection('connection')->create('table', ...)
(reference). If this is the case, the table is not being recognized by Larastan.Laravel code where the issue was found
The text was updated successfully, but these errors were encountered: