Laravel Framework version 4.2.11
IdeHelper has been extremely useful for providing autocomplete for Laravel facades.
I want to use a custom facade for one of my interfaces but I don't know how to get IdeHelper to find and parse my facade.
I have an interface defined in app/classes with two implementations for different environments
The bindings are in bootstrap/start.php
App::bind('AnInterface', 'AClass');
I have also defined a facade in app/classes
<?php
use Illuminate\Support\Facades\Facade;
/**
* Class AnApi
*
*/
class AnApi extends Facade {
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor() { return 'AnInterface'; }
}
Calling static methods on the facade AnApi::myMethod() call the correct methods on the object, but IdeHelper doesn't generate a class so the Ide doesn't autocomplete.
I've tried adding references in the config under 'extra' and 'interfaces' but nothing has worked so far.
Any help much appreciated.
thanks
Marcus
The IDE helper looks in for the aliases defined by the AliasLoader (usually the ones in app/config/app.php, the facades array). That should analyze the facade.
Thanks that has worked. I had to add my facade class to a namespace to get it to work.
@barryvdh OP reported it's solved, issue can be closed :}
Most helpful comment
The IDE helper looks in for the aliases defined by the AliasLoader (usually the ones in app/config/app.php, the facades array). That should analyze the facade.