Skip to content

[13.x] Allow the exception renderer to have additional source paths - #60487

Closed
SanderSander wants to merge 1 commit into
laravel:13.xfrom
SanderSander:improved-vendor-frames
Closed

SanderSander wants to merge 1 commit into
laravel:13.xfrom
SanderSander:improved-vendor-frames

Conversation

@SanderSander

Copy link
Copy Markdown
Contributor

This PR adds a new method to the \Illuminate\Foundation\Exceptions\Renderer\Renderer class that allows developers to specify additional source paths so that files in those paths are not considered "vendor code".

This will make the source code rendered on the exception page, and therefore super useful for package development.

My motivation for this is that I link my packages into the vendor directory when developing them.

Example: (I linked ./vendor/laravel/framework into ./../framework), and tested on Windows/Linux.

/project
   /vendor/laravel/framework  (symlink to /framework)
/framework
Renderer::sourcePaths([
    base_path('../vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware'),
]);
Screenshot 2026-06-11 112045

@taylorotwell

Copy link
Copy Markdown
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If applicable, please consider releasing your code as a package so that the community can still take advantage of your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants