Laravel 5.8 custom command not found
我使用工匠创建了一个自定义命令:
php artisan make:command resetNegotiations
与以下已删除的缓存相比:
php artisan cache:clear
但是,如果我尝试运行:php artisan ResetNegotiations,则会收到错误消息:
Command"ResetNegotiations" is not defined.
ResetNegotiations.php文件存在于app / Console / Commands
中
我发现了类似的问题:
-命令未定义异常,但未解决。
我已经将内核更新为app / Console / Kernel.php中的https://laravel.com/docs/5.8/artisan#registering-commands,但是……什么也没有。重建缓存后,也会出现相同的错误。
kernel.php
1 2 3 4 5 6 | .... protected $commands = [ Commands\ esetNegotiations::class, // ]; |
我缺少什么?
这是命令:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | <?php namespace App\\Console\\Commands; use Illuminate\\Console\\Command; class resetNegotiations extends Command{ /** * The name and signature of the console command. * * @var string */ protected $signature = 'command:name'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { // mail("######@#####.it","Scheduledartsan","Command test"); } |
} ??