Skip to content

Conversation

bzixilu
Copy link
Contributor

@bzixilu bzixilu commented Feb 15, 2019

This PR fixes laravel/ideas#1480 by adding the path of the view at the first line of compiled view in order to provide a possibility of Blade debugging in PhpStorm.

This pull-request is a simplified version of the pull-request filed before with fixed shortcomings: #27412 , @taylorotwell please take a look.

@taylorotwell taylorotwell merged commit cc15ef2 into laravel:5.8 Feb 18, 2019
@taylorotwell
Copy link
Member

Thanks!

@mfn
Copy link
Contributor

mfn commented Feb 27, 2019

@bzixilu this broke templates using declare(strict_types=1), please see #27704

@bzixilu
Copy link
Contributor Author

bzixilu commented Feb 28, 2019

@mfn oh, I didn't take strict types declaration into account, sorry for that. I'll take a look ASAP, thank you for reporting!

@screenager
Copy link

Having upgraded to the latest stable PhpStorm, this functionality only works if the path is added on top of the compiled view. It currently appends it to the bottom.

@bzixilu
Copy link
Contributor Author

bzixilu commented Mar 29, 2019

@screenager just to be sure, whether it was tested with 2019.1 Release or not?
If so could you please provide the minimized reproducible test case, I'll file the issue for investigation?

@screenager
Copy link

Tested with 2019.1 indeed
Cache path set to /storage/framework/views
Laravel 5.8.8, PHP 7.2.9
Did a "php artisan view:cache" on beforehand
Xdebug 2.6.1

Let me know if you need anything more

taylorotwell pushed a commit to illuminate/view that referenced this pull request Apr 5, 2019
This re-adds the functionality that was added in laravel/framework#27544 and laravel/framework#27976 and removed again in laravel/framework@33ce7bb.

The main difference with this approach is that it takes into account the issue from laravel/framework#27996. By not introducing a newline it doesn't changes anything to the rendered view itself. The path is now applied as the final piece of code. This doesn't allows IDE's to rely on it being the last line though. Instead we use /**PATH and ENDPATH**/ to make sure we have an easy way for the IDE to pick up the path it needs.
taylorotwell pushed a commit to illuminate/view that referenced this pull request May 11, 2021
This re-adds the functionality that was added in laravel/framework#27544 and laravel/framework#27976 and removed again in laravel/framework@33ce7bb.

The main difference with this approach is that it takes into account the issue from laravel/framework#27996. By not introducing a newline it doesn't changes anything to the rendered view itself. The path is now applied as the final piece of code. This doesn't allows IDE's to rely on it being the last line though. Instead we use /**PATH and ENDPATH**/ to make sure we have an easy way for the IDE to pick up the path it needs.
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.

Provide a way to retrieve blade/generated php paths mappings

4 participants