Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/larapack/command-verification
Makes Artisan Commands prompt the console if it should continue.
https://github.com/larapack/command-verification
Last synced: about 2 months ago
JSON representation
Makes Artisan Commands prompt the console if it should continue.
- Host: GitHub
- URL: https://github.com/larapack/command-verification
- Owner: larapack
- License: mit
- Created: 2015-11-27T13:59:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-13T21:22:03.000Z (almost 8 years ago)
- Last Synced: 2024-04-26T04:21:32.036Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Laravel Command Verification
Makes Artisan Commands prompt the console if it should continue.## Installing
Install using composer `composer require larapack/command-verification 1.*`.
## Usage
First add the trait `Verifiable` to your Artisan Command.
```
verify();
}
```If the user accept it will call the `verified`-method, so ensure you define that.
```
public function verified()
{
$this->info('We have destroyed your entire site. Thanks for using our command.');
}
```It will look like this:
![Command Line Example](https://raw.githubusercontent.com/larapack/command-verification/master/resources/command-line-example.png)
## Customizing
When calling the `verify`-method you can add the following parameters: `$this->verify($message, Closure $callback)`
```
public function fire()
{
return $this->verify('A custom verify message', function() {
$this->info('We have destroyed your entire site. Thanks for using our command.');
});
}
```This way you can overwrite the default verify message and the callback.