All Projects → wilderborn → Partyline

wilderborn / Partyline

Output to Laravel's console from outside of your Command classes.

Projects that are alternatives of or similar to Partyline

Tooling
Advancing Node.js as a framework for writing great tools
Stars: ✭ 98 (-41.67%)
Mutual labels:  command-line-tool, tooling, console
L5 Very Basic Auth
Stateless HTTP basic auth for Laravel without the need for a database.
Stars: ✭ 127 (-24.4%)
Mutual labels:  laravel, laravel-5-package
Typin
Declarative framework for interactive CLI applications
Stars: ✭ 126 (-25%)
Mutual labels:  command-line-tool, tooling
Artisan Menu
📝 Artisan Menu - Use Artisan via an elegant console GUI
Stars: ✭ 141 (-16.07%)
Mutual labels:  command-line-tool, laravel
L5 Swagger
OpenApi or Swagger integration to Laravel
Stars: ✭ 1,781 (+960.12%)
Mutual labels:  laravel, laravel-5-package
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (-28.57%)
Mutual labels:  laravel, laravel-5-package
Laravel Model Caching
Eloquent model-caching made easy.
Stars: ✭ 1,829 (+988.69%)
Mutual labels:  laravel, laravel-5-package
Laravel Excel
🚀 Supercharged Excel exports and imports in Laravel
Stars: ✭ 10,417 (+6100.6%)
Mutual labels:  laravel, laravel-5-package
Adminlte Laravel
A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template and Pratt Landing Page with Bootstrap 3.0
Stars: ✭ 1,814 (+979.76%)
Mutual labels:  laravel, laravel-5-package
Laravel Auto Translate
Automatically translate your language files using a translator service
Stars: ✭ 153 (-8.93%)
Mutual labels:  laravel, laravel-5-package
Laravel Page Speed
Package to optimize your site automatically which results in a 35%+ optimization
Stars: ✭ 2,097 (+1148.21%)
Mutual labels:  laravel, laravel-5-package
Pagination
🎁 Laravel 5 Custom Pagination Presenter
Stars: ✭ 119 (-29.17%)
Mutual labels:  laravel, laravel-5-package
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (-32.14%)
Mutual labels:  laravel, laravel-5-package
Laravel Form Builder
Laravel Form builder for version 5+!
Stars: ✭ 1,601 (+852.98%)
Mutual labels:  laravel, laravel-5-package
Vuejs2 Laravel53 Starter
A starter template for VueJs 2.0 with Laravel 5.4
Stars: ✭ 112 (-33.33%)
Mutual labels:  laravel, laravel-5-package
Laravel Swagger
Auto generates the swagger documentation of a laravel project based on best practices and simple assumptions
Stars: ✭ 129 (-23.21%)
Mutual labels:  laravel, laravel-5-package
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+1216.67%)
Mutual labels:  laravel, laravel-5-package
Llum
Llum (light in catalan language) illuminates your Laravel projects speeding up your Github/Laravel development workflow
Stars: ✭ 107 (-36.31%)
Mutual labels:  laravel, laravel-5-package
Credit Card
Credit Card Validation
Stars: ✭ 150 (-10.71%)
Mutual labels:  laravel, laravel-5-package
Laravel Mobile Detect
Mobile detection within Blade templates
Stars: ✭ 154 (-8.33%)
Mutual labels:  laravel, laravel-5-package

Partyline

This package allows you to output to the console from outside of command class.

For example, you might have a feature that does the same thing from a command and through the web. Until now, you may have found yourself duplicating code just to be able to output to the console in various places.

With Partyline, you can use output commands within your logic. If it's being run inside the console, you'll see it. Otherwise, nothing will happen.

Usage

In your console command's handle method, bind the command into Partyline:

public function handle()
{
    Partyline::bind($this);
}

Then in your regular classes, you may call any public Illuminate\Console\Command methods on the Partyline facade, just like you would inside the command class.

Partyline::info('foo');
// Equivalent to $this->info('foo') within your command.

Installation

This package can be installed through Composer.

composer require wilderborn/partyline

For Laravel 5.4 and below, register the service provider and facade:

// config/app.php
'providers' => [
    ...
    Wilderborn\Partyline\ServiceProvider::class,
    ...
],

'aliases' => [
    ...
    'Partyline' => Wilderborn\Partyline\Facade::class,
    ...
]

For Laravel 5.5+, this package will be automatically discovered.

Tips

If you have many commands classes, you may find it tedious to bind into Partyline every time. You may consider an abstract command class and bind inside the run method.

class YourCommand extends AbstractCommand
{
    public function handle()
    {
        //
    }
}
class AbstractCommand extends Command
{
    /**
     * Run the console command.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return int
     */
    public function run(InputInterface $input, OutputInterface $output)
    {
        Partyline::bind($this);

        return parent::run($input, $output);
    }
}

More info on our Statamic blog: https://statamic.com/blog/partyline

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].