Update database config to remove deprecation warning on php 8.5 - #2089
Conversation
📝 WalkthroughWalkthroughUpdates Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/database.php (1)
5-10: Fix sqlite database path variable typo/override (currently the absolute-path/:memory: branch is ignored).Right now the override assigns
$databasePath(Line 9), but sqlite uses$datapasePath(Line 44). This makes absolute paths and:memory:ineffective (and also looks like a simple typo).Proposed fix
$database = env('DB_DATABASE', 'database.sqlite'); -$datapasePath = database_path($database); +$databasePath = database_path($database); if (str_starts_with($database, '/') || $database === ':memory:') { $databasePath = $database; } ... 'sqlite' => [ 'driver' => 'sqlite', 'url' => env('DB_URL'), - 'database' => $datapasePath, + 'database' => $databasePath, 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 'busy_timeout' => null, 'journal_mode' => null, 'synchronous' => null, ],Also applies to: 41-45
🤖 Fix all issues with AI agents
In @config/database.php:
- Around line 67-69: Rename the misspelled $datapasePath to $databasePath and
remove the redundant assignment to $databasePath so the SQLite
absolute-path/:memory: override uses the correct variable (affects the SQLite
config and the variable declared near the top of the file); also extract the
PHP-version ternary that selects \Pdo\Mysql::ATTR_SSL_CA vs
\PDO::MYSQL_ATTR_SSL_CA into a single top-level variable (e.g., $mysqlSslCaAttr)
and use that variable in both MySQL and MariaDB 'options' arrays instead of
repeating the ternary to avoid duplication and drift.
Small followup for #2079 to remove some annoying deprecation warnings.
https://github.com/laravel/framework/blob/adb4eb81b62694c77d3ddba4506f4b475da43fbb/config/database.php#L64