Laravel $ schedule-> call()ReflectionException:类不存在

时间:2018-06-07 11:06:26

标签: php laravel-5.1

我尝试使用此命令测试 $ schedule-> call 方法(Kernel.php)。

php artisan schedule:run

然后它给了我这个错误:

  [ReflectionException]                                       
  Class App\Http\Controllers\DeactiveELV does not exist

源代码:     

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Log;
class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        \Log::info('Just for testing...');
         $schedule->call('App\Http\Controllers\DeactiveELV@shutdown')->everyMinute();
    }
}

0 个答案:

没有答案