laravel-debugbar
laravel-debugbar copied to clipboard
Support for Read-Only PDO in QueryCollector
Hello,
We've run into a few problems using Debugbar on our project as it is configured read-only.
To ensure there are no development mistakes, the read connection is configured with a live DB instance and the write connection is configured with invalid details, so it'll throw an error if anyone tries to write to the DB.
Debugbar appears to be trying to use the write connection rather than read, with read being Laravel's default for SELECT statements (and it would also be fine for EXPLAIN SELECT).
Would you consider replicating Laravel's default behaviour with this change to use the read PDO when nothing other than SELECTs are being used?
Regards, iamacarpet
@barryvdh we are still seeing this problem on Laravel 11.x with the latest version of debug bar.
Any chance you'd consider merging this please?
@barryvdh Same issue. Could you check this mr?