2017 © Pedro Peláez
 

package command-verification

Makes Artisan Commands prompt the console if it should continue.

image

larapack/command-verification

Makes Artisan Commands prompt the console if it should continue.

  • Friday, January 13, 2017
  • by marktopper
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel Command Verification

Makes Artisan Commands prompt the console if it should continue., (*1)

Installing

Install using composer composer require larapack/command-verification 1.*., (*2)

Usage

First add the trait Verifiable to your Artisan Command., (*3)

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Larapack/CommandVerification/Verifiable;

class ExampleCommand extends Command
{
  use Verifiable;

  // ...
}

In order to make the user verify that he wants to run this command you will have to set your fire-method to run the verify-method and set the verify-attribute., (*4)

  protected $verify = 'This command will destroy your entire site!';

  public function fire()
  {
      return $this->verify();
  }

If the user accept it will call the verified-method, so ensure you define that., (*5)

  public function verified()
  {
    $this->info('We have destroyed your entire site. Thanks for using our command.');
  }

It will look like this:, (*6)

Command Line Example, (*7)

Customizing

When calling the verify-method you can add the following parameters: $this->verify($message, Closure $callback), (*8)

  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., (*9)

The Versions

13/01 2017

dev-master

9999999-dev

Makes Artisan Commands prompt the console if it should continue.

  Sources   Download

MIT

laravel command artisan verification package verify larapack

30/11 2015

1.0.x-dev

1.0.9999999.9999999-dev

Makes Artisan Commands prompt the console if it should continue.

  Sources   Download

MIT

laravel command artisan verification package verify larapack

30/11 2015

dev-develop

dev-develop

Makes Artisan Commands prompt the console if it should continue.

  Sources   Download

MIT

laravel command artisan verification package verify larapack

30/11 2015

v1.0.0

1.0.0.0

Makes Artisan Commands prompt the console if it should continue.

  Sources   Download

MIT

laravel command artisan verification package verify larapack