PHP code example of deerdama / console-zoo-laravel

1. Go to this page and download the library: Download deerdama/console-zoo-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deerdama / console-zoo-laravel example snippets


class TestZoo extends Command
{
    use \Deerdama\ConsoleZoo\ConsoleZoo;

    //etc.......
}

    $this->zoo("Let's take it slow...", [
        'color' => 'light_blue_bright_2',
        'icons' => ['turtle'],
        'bold',
        'italic',
    ]);

    $this->surprise("message", [
        'category' => 'animals'
    ]);

  $this->zooInfo($message, $optionalParam);
  $this->zooSuccess($message, $optionalParam);
  $this->zooWarning($message);
  $this->zooError($message);

    $this->zooSetDefaults([
        'color' => 'cyan',
        'icons' => 'wolf',
        'bold'
    ]);

    // And then..
    $this->zoo("Meh, I'm just default..");

    $this->zoo("I'm the chosen one!!", [
        'icons' => 'pig_face',
        'swap',
        'italic'
    ]);

    $this->zooError("You are kind of boring..", [
        'icons' => false
    ]);

    $this->zooInfo("How about some sleep??", [
        'timestamp' => true
    ]);

    $this->time();
    $this->br();
    $this->time(['format' => 'H:i:s T', 'color' => 'blue']);
    $this->br();
    $this->time([
        'tz' => 'pst',
        'format' => 'jS \o\f F, Y H:i:s',
        'icons' => 'alarm_clock',
        'color' => 'green_bright_3'
    ]);

    $this->duration();

    $this->duration([
        'format' => 'Total duration %s.%f seconds',
        'color' => 'pink_bright_2',
        'icons' => 'snail'
    ]);
    
    $this->duration([
        'timestamp' => true,
        'format' => '%i min and %s sec',
        'icons' => false
    ]);

    $this->lap();
    
    $this->lap(true, ['prepend_text' => 'Lap {lap_number} duration: ']);

    $this->zoo("We want nuts...", [
        'color' => 'teal_light_1',
        'icons' => ['squirrel', 'squirrel', 'squirrel'],
        'bold',
    ]);
 
    $this->zooInfo("Tutturuuu...", ['icons_right' => 'dog']);

    $this->zooInfo("Tutturuuu...", ['icons_right' => false]);

    $this->zoo("Main style <zoo color='magenta' italic>inline style</zoo>, main again <zoo swap bold> 2nd inline </zoo>... 
                <zoo color='pink_bright_2' underline bold>it's not rocket science..</zoo> ", [
        'icons' => ['baby_chick'],
        'color' => 'blue'
    ]);

    $this->zoo("I'm actually a fluffy <icon>unicorn</icon>, really!!! <icon>face_with_sunglasses</icon>", [
        'color' => 'pink_bright_2',
        'icons' => ['horse'],
        'bold'
    ]);
shell
  php artisan vendor:publish --provider=Deerdama\\ConsoleZoo\\ConsoleZooServiceProvider
shell
  php artisan zoo:options