File Manager Lite
Dir:
/home/codewavebd/public_html/vendor/laravel/framework/src/Illuminate/Console
Upload
[..]
Attributes/
Rename
Del
Concerns/
Rename
Del
ConfirmableTrait.php (1.38 KB)
Edit
Rename
Del
ContainerCommandLoader.php (1.85 KB)
Edit
Rename
Del
Contracts/
Rename
Del
Events/
Rename
Del
Prohibitable.php (956 B)
Edit
Rename
Del
Scheduling/
Rename
Del
View/
Rename
Del
resources/
Rename
Del
Edit: ConfirmableTrait.php
<?php namespace Illuminate\Console; use function Laravel\Prompts\confirm; trait ConfirmableTrait { /** * Confirm before proceeding with the action. * * This method only asks for confirmation in production. * * @template TReturn of bool = bool * * @param string $warning * @param (\Closure(): TReturn)|TReturn|null $callback * @return (TReturn is false ? true : bool) */ public function confirmToProceed($warning = 'Application In Production', $callback = null) { $callback = is_null($callback) ? $this->getDefaultConfirmCallback() : $callback; $shouldConfirm = value($callback); if ($shouldConfirm) { if ($this->hasOption('force') && $this->option('force')) { return true; } $this->components->alert($warning); $confirmed = confirm('Are you sure you want to run this command?', default: false); if (! $confirmed) { $this->components->warn('Command cancelled.'); return false; } } return true; } /** * Get the default confirmation callback. * * @return \Closure(): bool */ protected function getDefaultConfirmCallback() { return function () { return $this->getLaravel()->environment() === 'production'; }; } }
Simpan