Added install command
This commit is contained in:
17
src/Console/InstallCommand.php
Normal file
17
src/Console/InstallCommand.php
Normal 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']);
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user