2017 © Pedro Peláez
 

library lconsole

Laravel Console (artisan, commands, visibility)

image

corex/lconsole

Laravel Console (artisan, commands, visibility)

  • Thursday, June 22, 2017
  • by corex
  • Repository
  • 0 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 7 % Grown

The README.md

CoRex Laravel Console

Laravel Console (artisan, commands, visibility)., (*1)

Versioning for this package follows http://semver.org/. Backwards compatibility might break on upgrade to major versions., (*2)

For bigger Laravel installations, the list of artisan commands can be quite long. This package enables you to have your own artisan with commands of your choice., (*3)

Warning: existing laravel commands such as route:list is only hidden. If you add a command with same signature as an existing command, it will override existing command. If this happens, you cannot use i.e. $this->call() to call the overridden Laravel Command., (*4)

Installation

Run "composer require corex/lconsole"., (*5)

Now you have 2 options., (*6)

Option 1

Register the provider and make commands available in Laravel artisan., (*7)

Add following code to AppServiceProviders@register method., (*8)

if ($this->app->environment() == 'local') {
    $this->app->register(\CoRex\Laravel\Console\ConsoleServiceProvider::class);
}

Option 2

Copy the file "artisan" in package to root of Laravel installation and rename it., (*9)

Setup artisan

Finally modify the created artisan file to suit your needs., (*10)

Example of a new artisan., (*11)

require_once(__DIR__ . '/vendor/autoload.php');

$artisan = new \CoRex\Laravel\Console\Artisan(__DIR__);

// Set name on artisan.
//$artisan->setName('name');

// Set version on artisan.
//$artisan->setVersion('x.y.z');

// Add single command.
//$artisan->addCommand(MyCommand::class);

// Add multiple commands on specified path.
//$artisan->addCommandsOnPath(path-to-commands, true, '');

$artisan->execute();

It is good practice to end all of your commands with the word "Command" i.e. "MyCommand". This way you can have only your commands added on "$artisan->addCommandsOnPath()" and not all other classes i.e. helpers., (*12)

Example of a modified artisan., (*13)

require_once(__DIR__ . '/vendor/autoload.php');

$artisan = new \CoRex\Laravel\Console\Artisan(__DIR__);

// Set name on artisan.
$artisan->setName('Test');

// Set version on artisan.
$artisan->setVersion('1.0.0');

// Add single command.
//$artisan->addCommand(MyCommand::class);

// Add multiple commands on specified path.
$artisan->addCommandsOnPath(__DIR__ . '/app/Console/Commands, true, '');

$artisan->execute();

The Versions

22/06 2017

dev-develop

dev-develop

Laravel Console (artisan, commands, visibility)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel command artisan

22/06 2017

dev-master

9999999-dev

Laravel Console (artisan, commands, visibility)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel command artisan

22/06 2017

1.0.1

1.0.1.0

Laravel Console (artisan, commands, visibility)

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel command artisan

22/06 2017

1.0.0

1.0.0.0

Laravel Console (artisan, commands, visibility)

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

laravel command artisan