Edited - this didn't solve my problem, it just changed it into a much more complicated one. I changed the post subject to reflect what I'm really stumped by.
I couldn't find anything in the forums but ended up solving my problem - posting this in hope it will save someone else a couple of hours messing around
Debugging was working in the project but it would NOT hit breakpoints set in the PHP class methods.
Answer was that I did not have Debugging Blade templates set correctly in PHPStorm. I needed to add the Cache path in Settings | PHP | Debug | Templates | Blade Debug and then everything worked as expected.
To solve the issue of PHPStorm not hitting breakpoints in PHP class methods within Blade files, you need to ensure that the Blade template debugging is configured correctly. Here's a step-by-step guide to setting it up:
Open PHPStorm Settings:
Go to File > Settings (or PHPStorm > Preferences on macOS).
Navigate to PHP Debug Settings:
In the settings window, go to Languages & Frameworks > PHP > Debug.
Configure Blade Template Debugging:
Look for the Blade Debug section.
You need to specify the path to the compiled Blade templates. This is usually located in the storage/framework/views directory of your Laravel project.
Set the Cache Path:
Add the path to the compiled Blade templates in the Blade Debug settings. This allows PHPStorm to map the Blade files to their compiled PHP counterparts, enabling proper debugging.
Verify Xdebug Configuration:
Ensure that Xdebug is correctly installed and configured in your PHP environment. Check that the xdebug.remote_enable and xdebug.remote_autostart settings are enabled in your php.ini file.
Restart PHPStorm and Your Web Server:
After making these changes, restart PHPStorm and your web server to ensure that the new settings take effect.
By following these steps, PHPStorm should be able to hit breakpoints set in PHP class methods within Blade files, allowing you to debug effectively. If you continue to experience issues, double-check your Xdebug configuration and ensure that your PHPStorm project is correctly set up to listen for incoming Xdebug connections.
I didn't understand my problem correctly. There's MUCH more to it than the PHPStorm Blade configuration.
I am now able to "debug" single file Livewire components but I am not actually stepping through the code.
Instead, I am stepping through the cached copy of the blade file so I am not really debugging.
The only variables which display correctly are those which are declared in the mount() function and then they only display their values at the time of mounting, if values are updated in the code the updated values are not reflected.
Can someone confirm or deny that the single file components can in fact be debugged with XDebug / PHPStorm?
@casc-or I'm experiencing the same issue. Wasted a day with all sorts of config changes in Xdebug and PhpStorm. The issue is just with Volt blade pages. Other php pages can be debugged fine. With Volt pages you can only see values for the class variables ($this). Editing other local variables doesn't reflect in debugging and even line stepping is flaky.
I also followed the PhpStorm Blade configuration to "/storage/framework/views", still no good.
I hope someone can come up with a solution, until then I can use dd() or standard Livewire pages with seperate code behind files.