Moved command to packages
This commit is contained in:
parent
ef622b9e9b
commit
8030b097e7
|
|
@ -1,42 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')
|
||||
// ->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
namespace Webkul\Core\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
namespace Webkul\Core\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
class install extends Command
|
||||
class Install extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
|
|
@ -10,6 +10,8 @@ use Webkul\Core\Core;
|
|||
use Webkul\Core\Facades\Core as CoreFacade;
|
||||
use Webkul\Core\Models\SliderProxy;
|
||||
use Webkul\Core\Observers\SliderObserver;
|
||||
use Webkul\Core\Console\Commands\BagistoVersion;
|
||||
use Webkul\Core\Console\Commands\Install;
|
||||
|
||||
class CoreServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -49,6 +51,8 @@ class CoreServiceProvider extends ServiceProvider
|
|||
public function register()
|
||||
{
|
||||
$this->registerFacades();
|
||||
|
||||
$this->registerCommands();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -66,6 +70,18 @@ class CoreServiceProvider extends ServiceProvider
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the console commands of this package
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([BagistoVersion::class, Install::class,]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register factories.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
namespace Webkul\Product\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Webkul\Product\Helpers\GenerateProduct;
|
||||
|
|
@ -7,6 +7,7 @@ use Illuminate\Support\ServiceProvider;
|
|||
use Webkul\Product\Models\ProductProxy;
|
||||
use Webkul\Product\Observers\ProductObserver;
|
||||
use Webkul\Product\Console\Commands\PriceUpdate;
|
||||
use Webkul\Product\Console\Commands\GenerateProducts;
|
||||
|
||||
class ProductServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -64,7 +65,7 @@ class ProductServiceProvider extends ServiceProvider
|
|||
protected function registerCommands(): void
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([PriceUpdate::class,]);
|
||||
$this->commands([PriceUpdate::class, GenerateProducts::class,]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue