2017 © Pedro Peláez
 

library laravel-wizartisan

Build your custom Laravel Artisan wizard commands.

image

hcesrl/laravel-wizartisan

Build your custom Laravel Artisan wizard commands.

  • Friday, March 2, 2018
  • by fsavina
  • Repository
  • 1 Watchers
  • 0 Stars
  • 169 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 16 % Grown

The README.md

hcesrl/laravel-wizartisan

Latest Stable Version Total Downloads License, (*1)

Installation

Install the package:, (*2)

composer require hcesrl/laravel-wizartisan

Usage

Create your wizard command extending the Wizartisan command. You must implement the configureWizard to add the steps to the wizard and the finish method that receives the validated data and completes the procedure., (*3)

<?php
namespace App\Console\Commands;

use Wizartisan\Command;

class CustomCommand extends Command
{

    protected function configureWizard ()
    {
        /**
         * Ask simple question with validation
         */
        $this->askQuestion ( 'What is your name?' )
             ->name ( 'name' )
             ->mustValidate ( 'required' );

        /**
         * Select option from given set
         */
        $this->askQuestion ( 'Choose your option:' )
             ->name ( 'option' )
             ->chooseFrom ( 
                [
                    'option1' => 'Option 1',
                    'option2' => 'Option 2',
                    'option3' => 'Option 3',
                ]
             );

        /**
         * Ask a question with confirmation and hide the answer
         */
        $this->askQuestion ( 'What is your secret password?' )
             ->name ( 'password' )
             ->hideAnswer ()
             ->withConfirmation ( 'You must confirm your password' );
    }


    protected function finish ( $data = [] )
    {
        $this->doSomethingWithTheValidInputData ( $data );

        return 0;
    }

}

License

This package is open-sourced software licensed under the MIT license., (*4)

Authors

The Versions

02/03 2018

dev-master

9999999-dev https://github.com/HCESrl/laravel-wizartisan

Build your custom Laravel Artisan wizard commands.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fabio Savina

laravel command cli artisan wizard

26/01 2018

v0.0.1

0.0.1.0 https://github.com/HCESrl/laravel-wizartisan

Build your custom Laravel Artisan wizard commands.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Fabio Savina

laravel command cli artisan wizard