2017 © Pedro Peláez
 

library laravel-command-util

Utils for a laravel command class

image

madnh/laravel-command-util

Utils for a laravel command class

  • Sunday, November 26, 2017
  • by madnh
  • Repository
  • 1 Watchers
  • 1 Stars
  • 111 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 2 % Grown

The README.md

Laravel Command Utils

Add util methods to laravel commands. Require Laravel/Lumen framework >= 5.0., (*1)

Installation

To get started with Command Utils, simply run:, (*2)

composer require madnh/laravel-command-util

Basic Usage

From your command, use MaDnh\LaravelCommandUtil\CommandUtil trait, (*3)

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use MaDnh\LaravelCommandUtil\CommandUtil;

class FooCommand extends Command
{
    use CommandUtil;

    //...
}

Methods

Banners

$this->banner('message'[, $options_as_array])

Banner, (*4)

$this->softBanner('message'[, $options_as_array])

Soft Banner, (*5)

Headers

$this->header('message'[, $options_as_array])

Header, (*6)

$this->softHeader('message'[, $options_as_array])

Soft Header, (*7)

Titles

$this->title('message'[, $options_as_array])

Title, (*8)

$this->softTitle('message'[, $options_as_array])

Soft Title, (*9)

Paragraph Title

$this->paragraphTitle('message'[, $options_as_array])

Paragraph Title, (*10)

Ordered List

$this->orderedList($items[, $options_as_array])

Ordered List, (*11)

Unordered List

$this->unorderedList($items[, $list_item_char])

Unordered List, (*12)

Continue to use previous ordered list index

$this->softTitle('Accusamus ea sit eos iusto dolore nemo.');
$index = $this->orderedList($items);

$this->softTitle('Aliquid quam ea error provident et.');
$this->orderedList($items, $index);

Continue previous ordered list, (*13)

Dynamic ordered lists

$this->softTitle('Publish files');

while($file = array_shift($files)){
    $this->line($this->getListIndex().$file->getFilename());
}

Dynamic ordered lists, (*14)

Reset dynamic ordered list index

$this->softTitle('Ut qui suscipit sequi sed.');
foreach ($items as $item) {
    $this->line($this->getListIndex().$item);
}

$this->resetOrderedList(30);

$this->softTitle('Eum beatae ea qui non aliquam.');
foreach ($items as $item) {
    $this->line($this->getListIndex().$item);
}

Reset index, (*15)

The Versions

26/11 2017

dev-master

9999999-dev

Utils for a laravel command class

  Sources   Download

MIT

The Requires

 

laravel command

26/11 2017

v1.2

1.2.0.0

Utils for a laravel command class

  Sources   Download

MIT

laravel command

31/07 2017

v1.1

1.1.0.0

Utils for a laravel command class

  Sources   Download

MIT

The Requires

 

laravel command

31/07 2017

v1.0

1.0.0.0

Utils for a laravel command class

  Sources   Download

MIT

The Requires

 

laravel command