Skip to content
Merged
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
42 changes: 42 additions & 0 deletions ProcessMaker/Console/Commands/OptimizeClearCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace ProcessMaker\Console\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Console\Attribute\AsCommand;

#[AsCommand(name: 'optimize:clear')]
class OptimizeClearCommand extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'optimize:clear';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove the cached bootstrap files';

/**
* Execute the console command.
*
* @return void
*/
public function handle()
{
$this->components->info('Clearing cached bootstrap files.');

collect([
'events' => fn () => $this->callSilent('event:clear') == 0,
'views' => fn () => $this->callSilent('view:clear') == 0,
'route' => fn () => $this->callSilent('route:clear') == 0,
])->each(fn ($task, $description) => $this->components->task($description, $task));

$this->newLine();
}
}