If you are using Laravel Herd, you can just add
zend_extension=/Applications/Herd.app/Contents/Resources/xdebug/xdebug-83-x86.so
xdebug.mode=develop,coverage
xdebug.start_with_request=yes
xdebug.start_upon_error=yes
To your php.ini.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Having an issue with xdebug showing the code coverage in a laravel 11 project.
artisan test --coverage
only shows the code coverage if I specify a directory
artisan test --coverage ./coverage/
Which would normally be fine but it does not run the (unit or feature) tests if --coverage is applied nor does it actually check the coverage, i.e. it lists all my controllers and models, but lists all coverage as 0% even if there are tests for that model/controller.
xDebug is definitely installed - it kind of works, and I don't see any documentation or reason as to why it would need a directory to (incorrectly) generate a report.
Anyone have any help with this?
Please or to participate in this conversation.