Frontman is a simple class that you can extend to create your own Laravel-style facades (or proxies, as they should be called).
Via Composer
$ composer require hassankhan/frontman
use Frontman\Proxy;
use Frontman\ProxyInterface;
class MyClass
{
public function foo()
{
echo 'Foo';
}
}
class MyOtherClass
{
protected $value;
public function __construct($value)
{
$this->value = $value;
}
public function bar()
{
echo 'Bar';
}
}
class MyProxy extends Proxy implements ProxyInterface
{
public static function getRealClass()
{
return 'MyClass';
}
}
class MyOtherProxy extends Proxy implements ProxyInterface
{
public static function getRealClass()
{
return 'MyOtherClass';
}
public static function getConstructorArguments()
{
return array('5');
}
}
MyProxy::foo(); // 'Foo'
MyOtherProxy::bar(); // 'Bar'
Please see CONTRIBUTING.md for details.
The MIT License (MIT). Please see LICENSE.md for more information.