codingyu / laravel-goto-view

vscode extension
MIT License
46 stars 28 forks source link

Add support for namespace-based routes #11

Closed hanishassim closed 5 years ago

hanishassim commented 5 years ago

Currently there's issue when there are 2 controllers of the same name, only to be differentiated by the path of the contorller's location.

for example, in my case:

Route::group(['namespace' => 'Web'], function () 
{
    Route::get('/', 'HomeController@index');
});

When there is namespace in the route, it will ignore it and navigate to HomeController located in the \app\Http\Controllers\HomeController.phpas opposed to the correct loaction at \app\Http\Controllers\Web\HomeController.php

ctf0 commented 5 years ago

this will never work because the package simply check for the text between quotes, also this will never work unless that is some sort of an external process the resolve the controller full name space.

the other reason this is hard to do is what if you have multiple namespaces ex.

Route::group(['namespace' => 'Admin'], function () 
{
    // ...

    Route::group(['namespace' => 'Web'], function () 
    {
        Route::get('/', 'HomeController@index');
    });
});
gauravmak commented 4 years ago

I needed this to work in almost all of my projects and developed an extension for it - https://marketplace.visualstudio.com/items?itemName=freshbitsweb.laravel-traveller

msadeghyan1996 commented 3 years ago

hey @gauravmak thank's , it's worked fine.