{"id":13828641,"url":"https://github.com/wilderborn/partyline","last_synced_at":"2025-04-04T07:06:39.110Z","repository":{"id":21496411,"uuid":"93088975","full_name":"wilderborn/partyline","owner":"wilderborn","description":"Output to Laravel's console from outside of your Command classes.","archived":false,"fork":false,"pushed_at":"2022-12-14T18:38:59.000Z","size":7,"stargazers_count":189,"open_issues_count":0,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-22T08:44:15.280Z","etag":null,"topics":["command-line-tool","console","laravel","laravel-5-package","statamic","tooling"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wilderborn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-01T18:46:50.000Z","updated_at":"2024-04-28T12:20:39.000Z","dependencies_parsed_at":"2023-01-13T21:31:15.481Z","dependency_job_id":null,"html_url":"https://github.com/wilderborn/partyline","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilderborn%2Fpartyline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilderborn%2Fpartyline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilderborn%2Fpartyline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilderborn%2Fpartyline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilderborn","download_url":"https://codeload.github.com/wilderborn/partyline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243597828,"owners_count":20316843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","console","laravel","laravel-5-package","statamic","tooling"],"created_at":"2024-08-04T09:02:56.510Z","updated_at":"2025-03-21T05:03:53.676Z","avatar_url":"https://github.com/wilderborn.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Partyline\n\nThis package allows you to output to the console from outside of command class.\n\nFor example, you might have a feature that does the same thing from a command and through the web.\nUntil now, you may have found yourself duplicating code just to be able to output to the console in various places.\n\nWith 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.\n\n## Usage\n\nIn your console command's `handle` method, bind the command into Partyline using the facade:\n\n``` php\npublic function handle()\n{\n    \\Partyline::bind($this);\n}\n```\n\nThen 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.\n\n``` php\n\\Partyline::info('foo');\n// Equivalent to $this-\u003einfo('foo') within your command.\n```\n\n### Facade usage\n\nYou can either use the globally aliased facade with a slash:\n\n```php\n\\Partyline::method();\n```\n\nOr, you can import the facade:\n\n```php\nuse Wilderborn\\Partyline\\Facade as Partyline;\n\nPartyline::method();\n```\n\n## Installation\n\nThis package can be installed through Composer.\n\n```\ncomposer require wilderborn/partyline\n```\n\nFor Laravel 5.4 and below, register the service provider and facade:\n\n``` php\n// config/app.php\n'providers' =\u003e [\n    ...\n    Wilderborn\\Partyline\\ServiceProvider::class,\n    ...\n],\n\n'aliases' =\u003e [\n    ...\n    'Partyline' =\u003e Wilderborn\\Partyline\\Facade::class,\n    ...\n]\n```\n\nFor Laravel 5.5+, this package will be [automatically discovered](https://medium.com/@taylorotwell/package-auto-discovery-in-laravel-5-5-ea9e3ab20518).\n\n## Tips\n\nIf 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.\n\n``` php\nclass YourCommand extends AbstractCommand\n{\n    public function handle()\n    {\n        //\n    }\n}\n```\n\n``` php\nclass AbstractCommand extends Command\n{\n    /**\n     * Run the console command.\n     *\n     * @param  \\Symfony\\Component\\Console\\Input\\InputInterface  $input\n     * @param  \\Symfony\\Component\\Console\\Output\\OutputInterface  $output\n     * @return int\n     */\n    public function run(InputInterface $input, OutputInterface $output)\n    {\n        \\Partyline::bind($this);\n\n        return parent::run($input, $output);\n    }\n}\n```\n\nMore info on our Statamic blog: \u003chttps://statamic.com/blog/partyline\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilderborn%2Fpartyline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilderborn%2Fpartyline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilderborn%2Fpartyline/lists"}