Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rahul286's avatar

How to hide default artisan commands from "php artisan list" of commands?

I am working on a CLI application based on Laravel 5.4.

I have created my custom commands and they are working as expected.

The only issue, I am facing is, whenever I run php artisan list, it shows all commands - my custom commands and default artisan commands.

I need to show only my custom commands in packaged app.

Is there any way to solve this?

Thanks.

p.s. I have already checked https://laracasts.com/discuss/channels/general-discussion/remove-default-commands-from-artisan and solution given there is not working.

0 likes
5 replies
zachleigh's avatar

If its only a command line app, you do not need the entire Laravel install. If you want it to work in a different Laravel app, make a Laravel package. If you just want a command line app, use the Symfony console component. You could even extract the Laravel console classes out to your app and wrap up the Symfony classes to make it a little easier to use.

1 like
rahul286's avatar

@zachleigh thanks for the answer.

We started as a command line app only and even explored the possibility of using Symfony/console.

As you have already guessed, Artisan (Laravel Console) is much easier to use, and I found packages such as https://github.com/moon0326/artisan which extracts Laravels console classes.

But as your application is growing we need a lot more stuff such as ORM, migrations, task scheduling, job queue and also RESTful API.

Earlier we thought we would use Symfony with different components, but when we started listing everything we need, Laravel seemed to have a lot many things in one place.

You may like to have a look at relevant issue for the list I am talking - https://github.com/EasyEngine/easyengine/issues/858

How would you have chosen between Laravel and Symfony console for a big command-line app?

Thanks again.

zachleigh's avatar
Level 47

@rahul286 I think in your case, Laravel makes a lot of sense, especially if you're planning on adding an api and web interface. Glad you found a solution!

1 like
rahul286's avatar

Thanks. you solved my another problem. :-)

I was concerned about starting with Laravel and instead was planning to use:

  1. Symfony/console for command-line-app
  2. Lumen or Slim for REST API
  3. Laravel for web interface

But as command line app contains all features I felt a single Laravel app would make more sense.

Please or to participate in this conversation.