Closed NickSdot closed 2 months ago
Hello.
I can make this work:
$this->loadViewsFrom([
__DIR__ . '/views/',
__DIR__ . '/Feature/views',
// ...
], 'admin');
Or you can add an ide.json
file to your project with:
{
"$schema": "https://laravel-ide.com/schema/laravel-ide-v2.json",
"view": {
"paths": [
{
"path": "custom/views",
"namespace": "admin"
},
{
"path": "/resources/modules/foo",
"namespace": "admin"
}
]
}
}
I can make this work:
You mean on your end it works in the current version; or that you could make it happen?
If the latter, I'd prefer and appreciate it. Always better to not maintain things in two places. 😃🙏
Edit: The Json approach works. It made me think if the following works, too. And it does. Even thouh I'd prefer to keep the array; this's good enough for the time being. So, no rush with making the arrray approach work.
$this->loadViewsFrom(__DIR__ . '/views', 'admin');
$this->loadViewsFrom(__DIR__ . '/Feature/views', 'admin');
I've implemented it. It will work in the next version. Thank you.
Hey Adelf! 👋
I just got my hands on the update, and would like to report back. 8.3.1.242 works as you described above. Thank you!
For others, the array must be passed in directly. Passing variables does not work.
// ✅
$this->loadViewsFrom([
__DIR__ . '/views/',
__DIR__ . '/Feature/views',
]; 'admin');
// ❌
$viewPaths = [
__DIR__ . '/views/',
__DIR__ . '/Feature/views',
];
$this->loadViewsFrom($viewPaths; 'admin');
Bug description
Hi Adelf! 👋
Laravel allows an array to be passed to the view loader:
This allows to have multiple paths under one namespace. In our case is a kinda fallback-mechanism / override under the same namespace.
It seems Laravel Idea cannot handle this. Completion and navigation do not / no longer (?) work.
Would be awesome if you could have a look. Cheers & thanks in advance1
Plugin version
8.2.5.242
Operating system
MacOS
Steps to reproduce
Relevant log output
No response