Skip to content

[Bug]: File links in "Laravel > Errors" panel do not open files when using Docker #1366

Description

@Lukasss93

Bug description

When clicking on a file name in the Laravel > Errors tool window provided by the Laravel plugin, the IDE fails to open the corresponding file only when the project is running inside a Docker container.
The root cause seems to be that the file paths reported by the Laravel application are container paths (e.g. /var/www/html/app/...), while the IDE expects host paths (e.g. /home/user/projects/my-app/app/...).

The plugin does not currently translate container paths back to the corresponding host paths, so the "Open file" action either does nothing or fails silently.
This behavior does not occur when Laravel runs directly on the host machine, since paths reported by the framework already match the actual filesystem paths known to the IDE.

Image

Possible Solution
The plugin should perform path remapping between the container and the host before attempting to open a file.
Example:
Read Docker path mappings from the IDE settings.
PhpStorm already stores path mappings for Docker-based CLI interpreters and deployment configurations (Settings → PHP → Servers, and Settings → PHP → CLI Interpreter → Docker container path mappings). The plugin could reuse these mappings to translate a container path like /var/www/html/app/Http/Controllers/Foo.php into the corresponding host path (e.g. /home/user/projects/my-app/app/Http/Controllers/Foo.php) before calling the "open file" action.

Plugin version

13.2.0.261

Operating system

Linux

Steps to reproduce

  1. Set up a Laravel project that runs inside a Docker container, mounting the project root to a container path (e.g. .//var/www/html).
  2. Configure the PHP interpreter in the IDE to use the Docker container (Settings → PHP → CLI Interpreter → From Docker).
  3. Trigger an error in the Laravel application (e.g. throw an exception from a controller or run an artisan command that fails).
  4. Open the Laravel > Errors tool window in the IDE.
  5. Locate the reported error and click on the file name / path shown in the stack trace or entry.
  6. Expected: The IDE opens the corresponding source file in the editor at the correct line.
  7. Actual: Nothing happens (or an error is shown), because the path /var/www/html/app/... does not exist on the host filesystem.

Relevant log output

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions