laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
166 stars 7 forks source link

[Feature Request]: Allow custom components namespace outside `App\` #625

Open aguingand opened 2 years ago

aguingand commented 2 years ago

Feature Description

In Jigsaw you can use components by using the Components\ namespace (docs) but I found no way the configure this in laravel idea.

If I set Components in the "Blade components classes namespace(inside App)", the namespace is not discovered (due to the "inside App" thing I guess)

image

Proposals

Using the settings

Prevent using App\ root if the namespace is defined inside composer.json autoload "psr-4" section.

Using ide.json

Add "classNamespace" options in the schema, e.g:

"blade": {
    "components": {
        "viewPaths": [
            {
                "path": "source/_components",
                "classNamespace": "Components",
            }
        ]
    }
}

I think the ide.json proposal is better because it's more flexible.

adelf commented 2 years ago

Hi. You can't setup Laravel Idea to correctly create components now. I'll try to add something. Thanks for posting.