Added install command

This commit is contained in:
asantibanez
2022-02-14 12:49:36 -05:00
parent 9e4d8ddf40
commit 202591954d
2 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace Asantibanez\LivewireCharts\Console;
use Illuminate\Console\Command;
class InstallCommand extends Command
{
protected $signature = 'livewire-charts:install';
protected $description = 'Installs Livewire Charts';
public function handle()
{
$this->call('vendor:publish', ['--tag' => 'livewire-charts:public']);
}
}

View File

@@ -7,6 +7,7 @@ use Asantibanez\LivewireCharts\Charts\LivewireColumnChart;
use Asantibanez\LivewireCharts\Charts\LivewireLineChart;
use Asantibanez\LivewireCharts\Charts\LivewirePieChart;
use Asantibanez\LivewireCharts\Charts\LivewireRadarChart;
use Asantibanez\LivewireCharts\Console\InstallCommand;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Livewire\Livewire;
@@ -15,7 +16,9 @@ class LivewireChartsServiceProvider extends ServiceProvider
{
public function boot()
{
$this->registerViews();
$this->registerCommands();
$this->registerViews();
$this->registerPublishables();
@@ -29,6 +32,16 @@ class LivewireChartsServiceProvider extends ServiceProvider
$this->app->bind('livewirecharts', LivewireCharts::class);
}
private function registerCommands()
{
if ($this->app->runningInConsole()) {
$this->commands([
InstallCommand::class,
]);
}
}
private function registerViews()
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'livewire-charts');