File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,18 @@ public static function getConnection($name = null)
129129 return static ::getInstance ()->get ($ name );
130130 }
131131
132+ /**
133+ * Set the default connection name.
134+ *
135+ * @param string|null $name
136+ *
137+ * @return static
138+ */
139+ public static function setDefaultConnection ($ name = null )
140+ {
141+ return static ::getInstance ()->setDefault ($ name );
142+ }
143+
132144 /**
133145 * Get the default connection.
134146 *
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ public function test_setting_default_connections()
6969 $ this ->assertInstanceOf (Connection::class, $ container ->get ('other ' ));
7070 $ this ->assertInstanceOf (Connection::class, $ container ->getDefault ());
7171
72- $ container -> setDefault ('non-existent ' );
72+ Container:: setDefaultConnection ('non-existent ' );
7373 $ this ->expectException (ContainerException::class);
7474 $ container ->getDefault ();
7575 }
You can’t perform that action at this time.
0 commit comments