getDefaultConfirmCallback() : $callback;// set the callback
$shouldConfirm = $callback instanceof Closure ? call_user_func($callback) : $callback;
// check the confirm is the instance of the Closure.
if ($shouldConfirm) {// the right confirm
if ($this->option('force')) {
return true;
}// has a key to said be 'fore'
$this->comment(str_repeat('*', strlen($warning) + 12));// set the comment string
$this->comment('* '.$warning.' *');// increment the
$this->comment(str_repeat('*', strlen($warning) + 12));// get the *
$this->output->writeln('');// use a function to be
$confirmed = $this->confirm('Do you really wish to run this command? [y/N]');
// set the confirm way
if (! $confirmed) {
$this->comment('Command Cancelled!');
return false;
}// get
}
return true;
}// confirm before the action be run
/**
* Get the default confirmation callback.
*
* @return \Closure
*/
protected function getDefaultConfirmCallback()
{
return function () {
return $this->getLaravel()->environment() == 'production';
};
}// Get the default confirmation
}