Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove old artisan command from Kernel in Laravel 5

I have created some Command files into my Laravel Application. Laravel version is 5.2. I set command like: get:email in the Command file. Also call the Command file into Kernel.php. After that I can see the artisan command list by typing the command php artisan list. as like as below:

//output
get:email

And I changed the command title get:email to get-bq:email. When I run the command php artisan get-bq:email -- its working nicely. Also I can see the list by typing the command php artisan list::

//output
get-bq:email

Issue / Problem: Both commands are working. But I won't to work with both of them. I have done the following things:

  1. modified command file as well as command
  2. run composer dump-autoload -o
  3. run composer update
  4. remove vendor and storage folder then run composer update again.

Still the old command is working into my system.

What I want: How May I remove my old commands from my Laravel(5.2) application?

like image 386
Selim Reza Avatar asked Oct 28 '25 12:10

Selim Reza


2 Answers

Run these commands:

php artisan cache:clear
php artisan config:clear

These commands will clear app cache and config cache and recreate it.

like image 182
Alexey Mezenin Avatar answered Oct 30 '25 01:10

Alexey Mezenin


I've had the same problem recently.

Repoeatedly tried

php artisan cache:clear
php artisan config:clear

and the cached Kernal command wouldn't clear.

In desperation i killed the queue worker terminal and restarted the queue with the command

php artisan queue:work

The issue stopped.

like image 31
Greenie Avatar answered Oct 30 '25 02:10

Greenie