laravel / sail

Docker files for running a basic Laravel application.
https://laravel.com/docs/sail
MIT License
1.7k stars 477 forks source link

Add "xdebug.start_with_request=yes" ini override #750

Closed emilh91 closed 2 weeks ago

emilh91 commented 2 weeks ago

… to enable enable "trigger-less" step debugging in IDE's.

The benefit of this is that developers do NOT need to add anything extra to the query params (e.g. ?XDEBUG_TRIGGER=foo) or POST body or COOKIES, to activate step debugging. As long as the debugger is listening and a breakpoint is hit, execution will be paused.


Here is a sample VS Code debug configuration (auto-generated, except for the pathMappings):

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "pathMappings": {
                "/var/www/html": "${workspaceFolder}"
            },
            "port": 9003
        }
    ]
}

And here is a screenshot of what it looks like:

Screenshot 2024-11-09 at 10 20 32 PM
taylorotwell commented 2 weeks ago

Going to hold off on this one for now.