Trying to go to a file inside code by clicking in Laravel VS Code
Asked Answered
F

4

7

I am using VS Code 1.33.1

I am trying to go to a file in my code by doing a CTRL + Click but it doesn't seem to work.

Visiting a file via click

As you may see, I would like to visit the AuthenticatesUsers file somewhere in my project. What is the click shortcut to do this?

Flexed answered 16/4, 2019 at 6:39 Comment(0)
E
15

To do that you need to install the PHP Intelephense. after installing let PHP Intelephense to scan the project and Ctrl + click on your class which will allow you go to the definition. if Ctrl + click didn't work try Alt + click

Erland answered 16/4, 2019 at 7:14 Comment(2)
When you say go to definition, do you mean open the file itself or just plain description ?Flexed
Ctrl + click will open the file. You could also press Alt + F12 to peek the definition if you don't need to open it.Outing
N
4

You can use Laravel Goto Extension in VS Code.

By Hovering you can go to

  • Go to Blade Template files (EX. hello.blade.php)

  • Go to Blade Component files (EX. )

  • Go to Controller and highlight method (EX. \Namespace\Controller.php@Method)

  • Go to Static files (EX. hello.js)

  • Go to Config files and highlight option (EX. config\app.php)

  • Go to Language files (EX. resources/lang/en/messages.php )

  • Go to .env and highlight option

Nadene answered 3/8, 2022 at 14:23 Comment(0)
H
2

Download the VSC extension Laravel goto view

Once downloaded, enable the extension and press Ctrl + click to navigate to the desire file as shown below:

enter image description here

Heth answered 26/3, 2021 at 10:36 Comment(1)
Is it works for Controller Route::get('/', [PostController::class,'index'])->name('home'); for example when i click on PostController it should go to that controller ??Nadene
G
0

bmewburn.vscode-intelephense-client

install this extensions in vs code

Gastrotomy answered 15/9, 2024 at 19:40 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Tangleberry

© 2022 - 2025 — McMap. All rights reserved.