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

SergioGregorutti's avatar

I can't see my Artisan created command

Hi everyone,

Im trying to create an Artisan command but for some reason is not working.

I can see my command on the list (php artisan list) and when I hit it I get this error:

[InvalidArgumentException]                               
  There are no commands defined in the "email" namespace.

I followed the steps on the official documentation: http://laravel.com/docs/5.1/artisan#writing-commands

This is my file generated on 'app/Console/Commands/SendEmails.php':

<?php

namespace Argemundo\Console\Commands;

use Illuminate\Console\Command;

class SendEmails extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'emails:send';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Send Emails queue';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->info('Test.');
    }
}

My Laravel version is 5.1.26 (LTS). I "think" that is working fine. I upgraded it manually.

Can someone help me?

Thanks in advance!

0 likes
4 replies
ohffs's avatar

Maybe it's because in the command you have the signature as 'emails:send' but the error you're getting from the artisan list is 'email' rather than 'emails'? Hard to say for sure without seeing the list or what you typed though.

SergioGregorutti's avatar

@ohffs Sorry, that was a mistake on my post.

Even with 'emails:send' is not working. And there's no new command on the artisan commands list.

ohffs's avatar
ohffs
Best Answer
Level 50

Have you registered the command in app/Console/Kernel.php?

Please or to participate in this conversation.