Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Console/ConfigCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Console;

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
Expand All @@ -13,12 +14,15 @@
#[AsCommand(name: 'config:cache')]
class ConfigCacheCommand extends Command
{
use ConfirmableTrait;

/**
* The console command name.
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'config:cache';
protected $signature = 'config:cache
{--force : Force the operation to run when in production}';

/**
* The console command description.
Expand Down Expand Up @@ -55,6 +59,10 @@ public function __construct(Filesystem $files)
*/
public function handle()
{
if (! $this->confirmToProceed()) {
return;
}

$this->callSilent('config:clear');

$config = $this->getFreshConfiguration();
Expand Down
10 changes: 9 additions & 1 deletion src/Illuminate/Foundation/Console/EventCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
namespace Illuminate\Foundation\Console;

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Foundation\Support\Providers\EventServiceProvider;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'event:cache')]
class EventCacheCommand extends Command
{
use ConfirmableTrait;

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'event:cache';
protected $signature = 'event:cache
{--force : Force the operation to run when in production}';

/**
* The console command description.
Expand All @@ -30,6 +34,10 @@ class EventCacheCommand extends Command
*/
public function handle()
{
if (! $this->confirmToProceed()) {
return;
}

$this->callSilent('event:clear');

file_put_contents(
Expand Down
12 changes: 10 additions & 2 deletions src/Illuminate/Foundation/Console/RouteCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Console;

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Routing\RouteCollection;
Expand All @@ -11,12 +12,15 @@
#[AsCommand(name: 'route:cache')]
class RouteCacheCommand extends Command
{
use ConfirmableTrait;

/**
* The console command name.
* The name and signature of the console command.
*
* @var string
*/
protected $name = 'route:cache';
protected $signature = 'route:cache
{--force : Force the operation to run when in production}';

/**
* The console command description.
Expand Down Expand Up @@ -51,6 +55,10 @@ public function __construct(Filesystem $files)
*/
public function handle()
{
if (! $this->confirmToProceed()) {
return;
}

$this->callSilent('route:clear');

$routes = $this->getFreshApplicationRoutes();
Expand Down
10 changes: 9 additions & 1 deletion src/Illuminate/Foundation/Console/ViewCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Foundation\Console;

use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Support\Collection;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -12,12 +13,15 @@
#[AsCommand(name: 'view:cache')]
class ViewCacheCommand extends Command
{
use ConfirmableTrait;

/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'view:cache';
protected $signature = 'view:cache
{--force : Force the operation to run when in production}';

/**
* The console command description.
Expand All @@ -33,6 +37,10 @@ class ViewCacheCommand extends Command
*/
public function handle()
{
if (! $this->confirmToProceed()) {
return;
}

$this->callSilent('view:clear');

$this->paths()->each(function ($path) {
Expand Down