Wakil Ahmed
Wakil Ahmed

Reputation: 1423

How I go to definitions of Laravel classes in visual studio code editor for windows?

I can't access the definition using ctrl+click. Even when I try using click+Go to definition it says no definition found.

Here I was trying to go to the main Statefulguard file by pressing F12

use Illuminate\Contracts\Auth\StatefulGuard;       

public function __construct(StatefulGuard $guard)    
{    
    $this->guard = $guard;    
}    

When I try  going to the definition

Upvotes: 8

Views: 6847

Answers (2)

Carlos
Carlos

Reputation: 706

intelephense like, if work for you ctrl + click go to definition

https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client

other you can install PHP namespace resover. for import/set the classes to header.

Upvotes: 5

kmuenkel
kmuenkel

Reputation: 2789

There's a composer package designed to generate files that work in conjunction with an IDE plugin to help with definition-tracking for Laravel abstractions. https://marketplace.visualstudio.com/items?itemName=georgykurian.laravel-ide-helper

Upvotes: 4

Related Questions