Skip to content

Instantly share code, notes, and snippets.

@illmatix
Last active May 6, 2019 23:24
Show Gist options
  • Select an option

  • Save illmatix/9032a017bc3afd6e472b936af6402f70 to your computer and use it in GitHub Desktop.

Select an option

Save illmatix/9032a017bc3afd6e472b936af6402f70 to your computer and use it in GitHub Desktop.
<?php
namespace MyProject\Facades;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Facade as BaseFacade;
use Volume;
use Trend;
class Indicator
{
protected $volume;
protected $trend;
public function __construct(Volume $volume, Trend $trend)
{
$this->volume = $volume;
$this->trend = $trend;
}
public function volume() {
return $this->volume->sma();
}
public function trend() {
return $this->trend->sma();
}
}
class Facade extends BaseFacade
{
protected static function getFacadeAccessor()
{
return 'indicator';
}
}
class IndicatorServiceProvider extends ServiceProvider
{
/**
* Boot the service provider.
*/
public function boot()
{
}
/**
* Register the service provider.
*/
public function register()
{
$this->app->singleton('indicator', function ($app) {
return App::make(Indicator::class);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment