2017 © Pedro Peláez
 

library hatchet

image

rareloop/hatchet

  • Sunday, July 15, 2018
  • by rareloop
  • Repository
  • 0 Watchers
  • 4 Stars
  • 21 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Hatchet - CLI for Lumberjack

CI Coveralls, (*1)

Installation

composer require rareloop/hatchet

Once installed you need to copy the hatchet file into your Lumberjack theme directory., (*2)

It is assuming you're using Lumberjack inside Bedrock. If not, you may need to make some changes to paths in the hatchet file, (*3)

Basic Usage

You can now access the Hatchet CLI from inside your Lumberjack theme directory:, (*4)

To show available commands

php hatchet list

To run a command

For a given command called test:command you would run the following:, (*5)

php hatchet test:command

Get additional help about a command

For a given command called test:command you would run the following:, (*6)

php hatchet help test:command

Adding Commands

To add additional commands to Hatchet add them to config/hatchet.php (create the file if it doesn't exist)., (*7)

// config/hatchet.php

return [
    'commands' => [
        MyCommand::class,
    ],
];

Writing Commands

Create a subclass of Rareloop\Hatchet\Commands\Command:, (*8)

namespace MyNamespace;

use Rareloop\Hatchet\Commands\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class ControllerMake extends Command
{
    protected $signature = 'test:command {paramName : The description of the parameter}';

    protected $description = 'A description of the command';

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        // Command implementation
    }
}

Hatchet uses the same $signature syntax as Laravel, see here for more information., (*9)

Hatchet Command is a subclass of Symfony's Command object, for more information on how to implement the execute() function see here., (*10)

The Versions