Skip to content

Commit d637b4a

Browse files
Support relative paths to SQLite databases (#54480)
* Support relative paths to SQLite databases Related: #45626, wintercms/storm#191 * Styling * Update SQLiteConnector.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent a254dbd commit d637b4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Connectors/SQLiteConnector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public function connect(array $config)
3030

3131
$path = realpath($config['database']);
3232

33+
if (! file_exists($path)) {
34+
$path = realpath(base_path($config['database']));
35+
}
36+
3337
// Here we'll verify that the SQLite database exists before going any further
3438
// as the developer probably wants to know if the database exists and this
3539
// SQLite driver will not throw any exception if it does not by default.

0 commit comments

Comments
 (0)