Laravel Console Task

This week I wrote a small package that you may find interesting for your Laravel Artisan commands. The package is called “Laravel Console Task” and it allows you to perform tasks outputting the result of it.

The result on the console

Github link: https://github.com/nunomaduro/laravel-console-task

You can install this package in your Laravel project with composer:

composer require nunomaduro/laravel-console-task

Requirements & usage:

  • PHP ≥ 7.0.0
  • Laravel ≥ v5.5.26
An usage example

Behind the scenes, the implementation of this package is pretty simple: Laravel v5.5.26 made the class Illuminate\Console\Command macroable, so basically we are making the task method available via service provider:

The Source code of Service Provider

If you like console applications, checkout the community project Laravel Zero, where this package will be included by default.

Did you find this package interesting? 👍