Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Command Bundle Laravel Package

draw/command-bundle

View on GitHub
Deep Wiki
Context7

DrawCommandBundle

This bundle allows triggering command from the sonata admin. It also logs every command execution in the database even if they have been started from the command line.

Configuration

The configuration lists the commands available from Sonata to be selected and executed:

draw_command:
    sonata:
        commands:
            clearCache:
                commandName: "redis:flushdb"
                label: "Clear Cache"
                icon: "fa-ban"
            reIndexSearch:
                commandName: "fos:elastica:populate"
                label: "Re-Index Search"
                icon: "fa-search-plus"

Logging command execution

All command execution are log in the databases. They also log the output, so you can debug them in case an error happen.

If you want to proper log the output from command line interface you must use the BufferedConsoleOutput for you output in bin/console:

$application->run($input, new \Draw\Bundle\CommandBundle\Console\Output\BufferedConsoleOutput());

Some predefined command are ignored by the command logging. This is a predefined list:

  • help
  • doctrine:database:drop
  • doctrine:database:create
  • cache:clear

Todo

  • Allow to configure the list of command that are ignored form the logger
  • Allow to have argument on the command execution, could be predefined from the configuration, an input in the admin, or a more complex input done by reverse engineering the arguments of a command
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
yandex/translate-api
voku/simple_html_dom
league/flysystem-vfs
bkwld/upchuck
filament/spatie-laravel-tags-plugin
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php