I can't see my Artisan created command

Posted 3 years ago by SergioGregorutti

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!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.