Coder Social home page Coder Social logo

laravel-console-summary's Introduction

Static Analysis Latest Stable Version License

About Laravel Console Summary

Laravel Console Summary was created by, and is maintained by Nuno Maduro, and is a replacement for the List Command in Laravel Console Applications. Beautiful Laravel Console Summary for Artisan or Laravel Zero.

Installation

Requires PHP 8.1+

Require Laravel Console Summary using Composer:

composer require nunomaduro/laravel-console-summary

Configuration

Publish the configuration

php artisan vendor:publish

You may want to clean up the summary screen by hiding some well-known commands from it. Of course, even hidden, they will still be available.

// config/laravel-console-summary.php

return [
    'hide' => [
        'make:*',
        'list'
    ],
];

You can also override the binary name that is output in the usage information, by adding a binary key to your config.

// config/laravel-console-summary.php

return [
    // ...
    
    'binary' => 'custom-name',
];

Contributing

Thank you for considering to contribute to Laravel Console Summary. All the contribution guidelines are mentioned here.

You can have a look at the CHANGELOG for constant updates & detailed information about the changes. You can also follow the Twitter account for latest announcements or just come say hi!: @enunomaduro

Support the development

Do you like this project? Support it by donating

License

Laravel Console Summary is an open-sourced software licensed under the MIT license.

laravel-console-summary's People

Contributors

caendesilva avatar laravel-shift avatar librevlad avatar nunomaduro avatar octoper avatar owenvoke avatar patrickdaze avatar steache avatar yazeed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-console-summary's Issues

Command aliases cause duplicates

Using with Laravel Zero

<?php
namespace App\Console\Commands;

use LaravelZero\Framework\Commands\Command;

class Projects extends Command
{
    protected $signature = 'projects';
    protected $description = 'List all running projects';

    public function __construct()
    {
        parent::__construct();
        $this->setAliases(['p']);
    }
// ...

I get

$ ./application

  Application  unreleased

  USAGE: application <command> [options] [arguments]

  projects     List all running projects
  projects     List all running projects

  app:build    Build a single file executable
  app:install  Install optional components
  app:rename   Set the application name

  make:command Create a new command

Changing the config publishing group?

Hey! Thanks for all the amazing packages you've made! I just wanted to ask about something first before creating a PR, just in case the current behaviour is intentional.

I think the key used for publishing the package's config file should be updated to specify what it belongs to this package. Right now, when running artisan vendor:publish it just says Tag: config which doesn't mean much on its own. I think it should be laravel-console-summary-config or similar, to match the name of the published file.

This is the line I'm referring to: LaravelConsoleSummaryServiceProvider.php#L31

A feature request to "mute" unused commands?

Hi! Not sure if Issues is the right place for feature requests, but let's try. I came across this package and it immediately became a must-have on my list - Artisan looks a little bit cleaner.

What I'm suggesting may also clean it up a lot. What if we had a way to optionally hide certain commands from the list via config file? Would be nice to get rid of some default commands on the list while still keeping them working. Is it technically possible?

Allow us to customise the command name used in the description

Current behaviour

When you run the SummaryCommand, the following line is output:

USAGE: westworld <command> [options] [arguments]

Note that I'll use westworld as a placeholder for our app name for simplicity.

The name of the command (in this case, westworld) is dictated by the ARTISAN_BINARY constant (

$output->write(" <fg=yellow;options=bold>USAGE:</> $binary <command> [options] [arguments]\n");
)

Problem description and feature request

In our use-case the ARTISAN_BINARY is different to what our users actually need to run. We have a bash-script that would be named westworld (in this example) that proxies the PHP script called westworld-php used by Laravel Zero.

Our users need to run westworld <command> [options] [arguments], but the summary outputs westworld-php <command> [options] [arguments].

Thanks to how well written this & Laravel Zero is, we are able to write our own SummaryCommand and overwrite the Describer's describeUsage() method - but that's a lot of overhead and is a little fragile.

Are you open to tweaking Describe.php to use a config variable to get the binary name rather than a constant?

For example:

    /**
     * Describes the application title.
     *
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return \NunoMaduro\LaravelConsoleSummary\Contracts\DescriberContract
     */
    protected function describeUsage(OutputInterface $output): DescriberContract
    {
        $binary = config('artisan_binary', ARTISAN_BINARY);
        $output->write("  <fg=yellow;options=bold>USAGE:</> $binary <command> [options] [arguments]\n");

        return $this;
    }

Open to other approaches too. We can also put an MR in for this too if it's something you're open to.

Let me know your thoughts!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.