Open webmake opened 7 years ago
@webmake it searches all subclasses from \Illuminate\Routing\Controller class, base laravel class for controllers. Why your bundle controllers isn't inherited from it? Do they have any common parent?
Oh sorry for desinformation a little bit,
Yes, I am extending that abstract class, and tested that works good if in group is defined namespace, but I simplified problem wrongly.
I forgot to mention that my case is that I use my own RouteServiceProvider
<?php
namespace Modules\Dummy\Providers;
use Illuminate\Routing\Router;
class RouteServiceProvider extends \Illuminate\Foundation\Support\Providers\RouteServiceProvider
{
protected $namespace = 'Modules\Dummy\Http\Controllers';
public function map(Router $router)
{
$this->mapWebRoutes($router);
}
protected function mapWebRoutes(Router $router)
{
$router->group([
'namespace' => $this->namespace,
'middleware' => 'web',
], function () {
require __DIR__ . '/../Http/routes.php';
});
}
}
My controller
<?php
namespace Modules\Dummy\Http\Controllers;
class DummyController extends \Illuminate\Routing\Controller
{
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
return view('index');
}
}
So namespace in route provider is invisible for routes.php file.
Do you have another RouteServiceProvider in this project?
Yes,
multiple, as much as modules are I guess, plus laravel installer generated default provider (app/Providers/RouteServiceProvider.php
)
Ok, thanks. Multiple default controllers namespaces. It can be fixed, I think. I'll try to do it a bit later.
Hi, using laravel modules via bundle or defining custom controllers (not in
\\App\\Http\\Controllers\\
path) doesn't work neither autocomplete, neither navigation (when defining namespace and after that controller). It still autocompletes with fully namespaced controller:I see it is hardcoded now https://github.com/Haehnchen/idea-php-laravel-plugin/blob/93285fad392c7fe221eafb2b482cd7d6b15ee3c9/src/de/espend/idea/laravel/controller/ControllerCollector.java#L28
Wouldn't it be possible at least add controllers manually in phpstorm plugin configs? Or maybe there is way bypass this?