-
Notifications
You must be signed in to change notification settings - Fork 324
Open
Labels
Description
in config/models.php:
there are following code:
// 'connections' => [
// 'read_only_external' => [
// 'parent' => \App\Models\ReadOnlyModel::class,
// 'connection' => true,
// 'users' => [
// 'connection' => false,
// ],
// 'my_other_database' => [
// 'password_resets' => [
// 'connection' => false,
// ]
// ]
// ],
I believe the examples is not correct. the 'connections' shall be '@connections' according to the source code in src/Coders/Model/Config.php:
public function get(Blueprint $blueprint, $key, $default = null)
{
$priorityKeys = [
"@connections.{$blueprint->connection()}.{$blueprint->table()}.$key",
"@connections.{$blueprint->connection()}.{$blueprint->schema()}.$key",
"@connections.{$blueprint->connection()}.$key",
"{$blueprint->qualifiedTable()}.$key",
"{$blueprint->schema()}.$key",
"*.$key",
];
foreach ($priorityKeys as $key) {
$value = Arr::get($this->config, $key);
if (!is_null($value)) {
return $value;
}
}
return $default;
}