Environment
-
拉威尔版本:5.1.45 (LTS)
-
PHP版本:5.6.1
Description
我正在try 使用Laravel Task Scheduling每1分钟运行一次命令.
Attempt
我已将这一行添加到我的cron选项卡文件中
* * * * * php artisan schedule:run >> /dev/null 2>&1
Here is my /app/Console/Kernel.php
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\App\Console\Commands\Inspire::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')->hourly();
$schedule->command('echo "Happy New Year!" ')->everyMinute(); //<---- ADD HERE }
}
I've added this line $schedule->command('echo "Happy New Year!" ')->everyMinute();
Question
我如何测试这个?
How do I trigger my echo to display ?
我怎么知道我的所作所为是否正确呢?