Skip to content

[13.x] Guard base_path() call in SQLiteConnector for standalone usage#60266

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
YoussefMansour9:fix/sqlite-base-path-standalone
May 25, 2026
Merged

[13.x] Guard base_path() call in SQLiteConnector for standalone usage#60266
taylorotwell merged 1 commit into
laravel:13.xfrom
YoussefMansour9:fix/sqlite-base-path-standalone

Conversation

@YoussefMansour9
Copy link
Copy Markdown
Contributor

When using illuminate/database as a standalone package (without the full Laravel framework), the base_path() helper function is not available because it is defined in Illuminate\Support\helpers.php which is only loaded with the full framework package.

This causes a fatal error when connecting to a SQLite database with a relative path:

Call to undefined function Illuminate\Database\Connectors\base_path()

Guard the call with function_exists() so the connector works standalone. When base_path() is unavailable, the path resolution falls through to the existing SQLiteDatabaseDoesNotExistException.

Fixes #60260

…el#60260)

When using illuminate/database as a standalone package (without the full
Laravel framework), the base_path() helper function is not available.
Guard the call with function_exists() to prevent a fatal error.
@taylorotwell taylorotwell merged commit 39cb3f2 into laravel:13.x May 25, 2026
25 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call to undefined function Illuminate\Database\Connectors\base_path() when using Illuminate/database as library

2 participants