Comments Updated

This commit is contained in:
devansh bawari 2021-09-08 14:17:49 +05:30
parent fa6b10987f
commit ad08dc930b
5 changed files with 48 additions and 19 deletions

View File

@ -17,6 +17,13 @@ class DownChannelCommand extends OriginalCommand
{--secret= : The secret phrase that may be used to bypass maintenance mode}
{--status=503 : The status code that should be used when returning the maintenance mode response}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Down channel command. Same as parent but database will not update.';
/**
* Execute the console command.
*

View File

@ -7,6 +7,11 @@ use Webkul\Core\Models\Channel;
class DownCommand extends OriginalCommand
{
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->downAllChannels();
@ -14,6 +19,11 @@ class DownCommand extends OriginalCommand
parent::handle();
}
/**
* Update all channels.
*
* @return mixed
*/
protected function downAllChannels()
{
$this->comment('All channels are down.');

View File

@ -3,7 +3,6 @@
namespace Webkul\Core\Console\Commands;
use Illuminate\Foundation\Console\UpCommand as OriginalCommand;
use Webkul\Core\Models\Channel;
class UpChannelCommand extends OriginalCommand
{
@ -14,6 +13,18 @@ class UpChannelCommand extends OriginalCommand
*/
protected $name = 'channel:up';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Up channel command. Same as parent but database will not update.';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
parent::handle();

View File

@ -7,6 +7,11 @@ use Webkul\Core\Models\Channel;
class UpCommand extends OriginalCommand
{
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$this->upAllChannels();
@ -14,6 +19,11 @@ class UpCommand extends OriginalCommand
parent::handle();
}
/**
* Update all channels.
*
* @return mixed
*/
protected function upAllChannels()
{
$this->comment('Activating all channels.');

View File

@ -8,14 +8,6 @@ use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider;
use Webkul\Core\Console\Commands\BagistoVersion;
use Webkul\Core\Console\Commands\BookingCron;
use Webkul\Core\Console\Commands\DownChannelCommand;
use Webkul\Core\Console\Commands\DownCommand;
use Webkul\Core\Console\Commands\ExchangeRateUpdate;
use Webkul\Core\Console\Commands\Install;
use Webkul\Core\Console\Commands\UpChannelCommand;
use Webkul\Core\Console\Commands\UpCommand;
use Webkul\Core\Core;
use Webkul\Core\Exceptions\Handler;
use Webkul\Core\Facades\Core as CoreFacade;
@ -71,11 +63,11 @@ class CoreServiceProvider extends ServiceProvider
});
$this->app->extend('command.down', function () {
return new DownCommand;
return new \Webkul\Core\Console\Commands\DownCommand;
});
$this->app->extend('command.up', function () {
return new UpCommand;
return new \Webkul\Core\Console\Commands\UpCommand;
});
}
@ -109,7 +101,7 @@ class CoreServiceProvider extends ServiceProvider
}
/**
* Register the console commands of this package
* Register the console commands of this package.
*
* @return void
*/
@ -117,16 +109,16 @@ class CoreServiceProvider extends ServiceProvider
{
if ($this->app->runningInConsole()) {
$this->commands([
BagistoVersion::class,
Install::class,
ExchangeRateUpdate::class,
BookingCron::class,
\Webkul\Core\Console\Commands\BagistoVersion::class,
\Webkul\Core\Console\Commands\Install::class,
\Webkul\Core\Console\Commands\ExchangeRateUpdate::class,
\Webkul\Core\Console\Commands\BookingCron::class,
]);
}
$this->commands([
DownChannelCommand::class,
UpChannelCommand::class,
\Webkul\Core\Console\Commands\DownChannelCommand::class,
\Webkul\Core\Console\Commands\UpChannelCommand::class,
]);
}
@ -134,7 +126,6 @@ class CoreServiceProvider extends ServiceProvider
* Register factories.
*
* @param string $path
*
* @return void
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/