Added LivewireCharts facade
This commit is contained in:
27
src/Facades/LivewireCharts.php
Normal file
27
src/Facades/LivewireCharts.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Asantibanez\LivewireCharts\Facades;
|
||||
|
||||
use Asantibanez\LivewireCharts\Models\AreaChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\ColumnChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\LineChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\PieChartModel;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* Class LivewireCharts
|
||||
* @package Asantibanez\LivewireCharts\Facades
|
||||
* @method static LineChartModel lineChartModel()
|
||||
* @method static LineChartModel multiLineChartModel()
|
||||
* @method static ColumnChartModel columnChartModel()
|
||||
* @method static ColumnChartModel multiColumnChartModel()
|
||||
* @method static AreaChartModel areaChartModel()
|
||||
* @method static PieChartModel pieChartModel()
|
||||
*/
|
||||
class LivewireCharts extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'livewirecharts';
|
||||
}
|
||||
}
|
||||
47
src/LivewireCharts.php
Normal file
47
src/LivewireCharts.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Asantibanez\LivewireCharts;
|
||||
|
||||
|
||||
use Asantibanez\LivewireCharts\Models\AreaChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\ColumnChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\LineChartModel;
|
||||
use Asantibanez\LivewireCharts\Models\PieChartModel;
|
||||
|
||||
class LivewireCharts
|
||||
{
|
||||
public function lineChartModel()
|
||||
{
|
||||
return (new LineChartModel)
|
||||
->singleLine();
|
||||
}
|
||||
|
||||
public function multiLineChartModel()
|
||||
{
|
||||
return (new LineChartModel)
|
||||
->multiLine();
|
||||
}
|
||||
|
||||
public function columnChartModel()
|
||||
{
|
||||
return (new ColumnChartModel)
|
||||
->singleColumn();
|
||||
}
|
||||
|
||||
public function multiColumnChartModel()
|
||||
{
|
||||
return (new ColumnChartModel)
|
||||
->multiColumn();
|
||||
}
|
||||
|
||||
public function areaChartModel()
|
||||
{
|
||||
return new AreaChartModel;
|
||||
}
|
||||
|
||||
public function pieChartModel()
|
||||
{
|
||||
return new PieChartModel;
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,6 @@ class LivewireChartsServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
$this->app->bind('livewirecharts', LivewireCharts::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user